Removed parent project and combined its capabilities in to the BOM pom.xml in the root folder.
diff --git a/admin.services/pom.xml b/admin.services/pom.xml
index b3c2fea..799d039 100644
--- a/admin.services/pom.xml
+++ b/admin.services/pom.xml
@@ -4,13 +4,12 @@
<parent>
<groupId>eclipselink.example.mysports</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0</version>
- <relativePath>../parent</relativePath>
+ <artifactId>bom</artifactId>
+ <version>2.4.2-SNAPSHOT</version>
+ <relativePath>..</relativePath>
</parent>
<artifactId>admin.services</artifactId>
- <version>2.4.2-SNAPSHOT</version>
<packaging>jar</packaging>
<name>MySports Admin Services</name>
@@ -84,11 +83,17 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
- <argLine>-javaagent:${user.home}/.m2/repository/eclipselink/example/mysports/persistence/${project.version}/persistence-${project.version}.jar</argLine>
+ <argLine>-javaagent:../persistence/target/persistence-${project.version}.jar</argLine>
<excludedGroups>eclipselink.example.mysports.admin.services.test.services.ServerTests</excludedGroups>
+ <systemProperties>
+ <property>
+ <name>derby.stream.error.file</name>
+ <value>target/derby.log</value>
+ </property>
+ </systemProperties>
</configuration>
</plugin>
-
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
diff --git a/admin.web/pom.xml b/admin.web/pom.xml
index 37dcef0..b986788 100644
--- a/admin.web/pom.xml
+++ b/admin.web/pom.xml
@@ -4,13 +4,12 @@
<parent>
<groupId>eclipselink.example.mysports</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0</version>
- <relativePath>../parent</relativePath>
+ <artifactId>bom</artifactId>
+ <version>2.4.2-SNAPSHOT</version>
+ <relativePath>..</relativePath>
</parent>
<artifactId>admin.web</artifactId>
- <version>2.4.2-SNAPSHOT</version>
<packaging>war</packaging>
<name>MySports Admin WebApp</name>
diff --git a/application/pom.xml b/application/pom.xml
index 5df8aff..58637da 100644
--- a/application/pom.xml
+++ b/application/pom.xml
@@ -4,13 +4,12 @@
<parent>
<groupId>eclipselink.example.mysports</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0</version>
- <relativePath>../parent</relativePath>
+ <artifactId>bom</artifactId>
+ <version>2.4.2-SNAPSHOT</version>
+ <relativePath>..</relativePath>
</parent>
<artifactId>application</artifactId>
- <version>2.4.2-SNAPSHOT</version>
<packaging>war</packaging>
<name>MySports WebApp</name>
@@ -121,7 +120,13 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
- <argLine>-javaagent:${user.home}/.m2/repository/eclipselink/example/mysports/persistence/${eclipselink.version}/persistence-${eclipselink.version}.jar</argLine>
+ <argLine>-javaagent:../persistence/target/persistence-${eclipselink.version}.jar</argLine>
+ <systemProperties>
+ <property>
+ <name>derby.stream.error.file</name>
+ <value>target/derby.log</value>
+ </property>
+ </systemProperties>
</configuration>
</plugin>
</plugins>
diff --git a/parent/.project b/parent/.project
deleted file mode 100644
index b9b4caf..0000000
--- a/parent/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>parent</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
diff --git a/parent/.settings/org.eclipse.m2e.core.prefs b/parent/.settings/org.eclipse.m2e.core.prefs
deleted file mode 100644
index f897a7f..0000000
--- a/parent/.settings/org.eclipse.m2e.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-activeProfiles=
-eclipse.preferences.version=1
-resolveWorkspaceProjects=true
-version=1
diff --git a/parent/pom.xml b/parent/pom.xml
deleted file mode 100644
index 51cb6dc..0000000
--- a/parent/pom.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>eclipselink.example.mysports</groupId>
- <artifactId>bom</artifactId>
- <version>1.0.0</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>parent</artifactId>
- <packaging>pom</packaging>
- <name>MySports Parent</name>
- <modules>
- <module>../admin.services</module>
- <module>../admin.web</module>
- <module>../application</module>
- <module>../persistence</module>
-
- </modules>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.11</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
diff --git a/persistence/pom.xml b/persistence/pom.xml
index 63f439f..0dffbab 100644
--- a/persistence/pom.xml
+++ b/persistence/pom.xml
@@ -4,13 +4,12 @@
<parent>
<groupId>eclipselink.example.mysports</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0</version>
- <relativePath>../parent</relativePath>
+ <artifactId>bom</artifactId>
+ <version>2.4.2-SNAPSHOT</version>
+ <relativePath>..</relativePath>
</parent>
<artifactId>persistence</artifactId>
- <version>2.4.2-SNAPSHOT</version>
<packaging>jar</packaging>
<name>MySports Persistence</name>
@@ -74,7 +73,12 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
- <!-- <argLine>-javaagent:${user.home}\\.m2\\repository\\eclipselink\\example\\mysports\\persistence\\${project.version}\\persistence-${project.version}.jar</argLine> -->
+ <systemProperties>
+ <property>
+ <name>derby.stream.error.file</name>
+ <value>target/derby.log</value>
+ </property>
+ </systemProperties>
</configuration>
</plugin>
diff --git a/persistence/src/test/java/eclipselink/example/mysports/test/common/ExamplePropertiesLoader.java b/persistence/src/test/java/eclipselink/example/mysports/test/common/ExamplePropertiesLoader.java
index 4137529..c3c5b4f 100644
--- a/persistence/src/test/java/eclipselink/example/mysports/test/common/ExamplePropertiesLoader.java
+++ b/persistence/src/test/java/eclipselink/example/mysports/test/common/ExamplePropertiesLoader.java
@@ -14,6 +14,8 @@
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.Properties;
@@ -61,26 +63,24 @@
}
public static void loadProperties(Map<String, Object> properties, File file) {
- try {
- if (file.exists()) {
- Properties exampleProps = new Properties();
- InputStream in = new FileInputStream(file);
- exampleProps.load(in);
- in.close();
-
- for (Map.Entry<Object, Object> entry : exampleProps.entrySet()) {
- properties.put((String) entry.getKey(), entry.getValue());
- }
+ if (file.exists()) {
+ InputStream in;
+ try {
+ in = new FileInputStream(file);
+ } catch (FileNotFoundException e) {
+ return;
}
- } catch (Exception e) {
- // ignore
+ loadProperties(properties, in);
}
}
public static void loadProperties(Map<String, Object> properties, ClassLoader cl, String resource) {
+ InputStream in = cl.getResourceAsStream(resource);
+ loadProperties(properties, in);
+ }
+
+ public static void loadProperties(Map<String, Object> properties, InputStream in) {
try {
- InputStream in = cl.getResourceAsStream(resource);
-
if (in != null) {
Properties exampleProps = new Properties();
exampleProps.load(in);
@@ -92,6 +92,14 @@
}
} catch (Exception e) {
// ignore
+ } finally {
+ try {
+ in.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
}
+
}
diff --git a/pom.xml b/pom.xml
index e59774f..0c9fc50 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
<groupId>eclipselink.example.mysports</groupId>
<artifactId>bom</artifactId>
- <version>1.0.0</version>
+ <version>2.4.2-SNAPSHOT</version>
<packaging>pom</packaging>
<name>MySports BOM</name>
<url>http://wiki.eclipse.org/EclipseLink/Examples/MySports</url>
@@ -50,12 +50,24 @@
</repositories>
<modules>
- <module>parent</module>
+ <module>admin.services</module>
+ <module>admin.web</module>
+ <module>application</module>
+ <module>persistence</module>
</modules>
- <build>
- <defaultGoal>install</defaultGoal>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <defaultGoal>package</defaultGoal>
+
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>