Make shared resource handling a top-level feature
authorGeorgios Gousios <gousiosg@gmail.com>
Fri, 16 Sep 2011 09:47:57 +0000 (12:47 +0300)
committerGeorgios Gousios <gousiosg@gmail.com>
Fri, 16 Sep 2011 09:47:57 +0000 (12:47 +0300)
logic/pom.xml
model/pom.xml
pom.xml
shared/src/main/resources/META-INF/orm.xml [deleted file]
shared/src/main/resources/META-INF/persistence.xml
shared/src/main/resources/shared.txt

index a4e4fd9..476f4f9 100644 (file)
@@ -1,12 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<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/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
+
   <parent>
     <artifactId>aquarium</artifactId>
     <groupId>gr.grnet</groupId>
     <version>0.0.1-SNAPSHOT</version>
   </parent>
+
   <groupId>gr.grnet.aquarium</groupId>
   <artifactId>logic</artifactId>
   <version>0.0.1-SNAPSHOT</version>
       <artifactId>scalajpa_2.9.1</artifactId>
       <version>1.4</version>
     </dependency>
+    <dependency>
+      <groupId>gr.grnet.aquarium</groupId>
+      <artifactId>shared</artifactId>
+      <version>0.0.1-SNAPSHOT</version>
+      <classifier>resources</classifier>
+      <type>zip</type>
+      <scope>provided</scope>
+    </dependency>
   </dependencies>
 
 </project>
index 9fd4183..dbb27e1 100644 (file)
   <dependencies>
     <dependency>
       <groupId>org.eclipse.persistence</groupId>
-      <artifactId>eclipselink</artifactId>
-      <version>2.2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.persistence</groupId>
       <artifactId>javax.persistence</artifactId>
       <version>2.0.3</version>
     </dependency>
     <dependency>
-      <groupId>com.h2database</groupId>
-      <artifactId>h2</artifactId>
-      <version>1.3.160</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>mysql</groupId>
-      <artifactId>mysql-connector-java</artifactId>
-      <version>5.1.17</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.scala-libs</groupId>
-      <artifactId>scalajpa_2.9.1</artifactId>
-      <version>1.4</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>gr.grnet.aquarium</groupId>
       <artifactId>shared</artifactId>
       <version>0.0.1-SNAPSHOT</version>
       <scope>provided</scope>
     </dependency>
   </dependencies>
-
-  <repositories>
-    <repository>
-      <id>EclipseLink Repo</id>
-      <url>http://www.eclipse.org/downloads/download.php?r=1&amp;nf=1&amp;file=/rt/eclipselink/maven.repo</url>
-    </repository>
-  </repositories>
-
-  <build>
-    <resources>
-      <resource>
-        <directory>${basedir}/src/main/resources</directory>
-      </resource>
-      <resource>
-        <directory>${project.build.directory}/generated-resources</directory>
-        <filtering>true</filtering>
-      </resource>
-    </resources>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>unpack-shared-resources</id>
-            <goals>
-              <goal>unpack-dependencies</goal>
-            </goals>
-            <phase>generate-resources</phase>
-            <configuration>
-              <outputDirectory>${project.build.directory}/generated-resources
-              </outputDirectory>
-              <includeArtifacIds>shared</includeArtifacIds>
-              <includeGroupIds>${project.groupId}</includeGroupIds>
-              <excludeTransitive>true</excludeTransitive>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-
 </project>
diff --git a/pom.xml b/pom.xml
index 787d1ba..4018531 100644 (file)
--- a/pom.xml
+++ b/pom.xml
       <name>java.net Maven2 Repository</name>
       <url>http://download.java.net/maven/2/</url>
     </repository>
+    <repository>
+      <id>EclipseLink Repo</id>
+      <url>http://www.eclipse.org/downloads/download.php?r=1&amp;nf=1&amp;file=/rt/eclipselink/maven.repo</url>
+    </repository>
   </repositories>
 
   <pluginRepositories>
       <version>4.7</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.eclipse.persistence</groupId>
+      <artifactId>eclipselink</artifactId>
+      <version>2.2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>com.h2database</groupId>
+      <artifactId>h2</artifactId>
+      <version>1.3.160</version>
+    </dependency>
+    <dependency>
+      <groupId>mysql</groupId>
+      <artifactId>mysql-connector-java</artifactId>
+      <version>5.1.17</version>
+    </dependency>
+    <dependency>
+      <groupId>org.scala-libs</groupId>
+      <artifactId>scalajpa_2.9.1</artifactId>
+      <version>1.4</version>
+    </dependency>
   </dependencies>
 
   <!--Configuration shared with subprojects-->
   <build>
     <sourceDirectory>src/main/scala</sourceDirectory>
     <testSourceDirectory>src/test/scala</testSourceDirectory>
+    <resources>
+      <resource>
+        <directory>${basedir}/src/main/resources</directory>
+      </resource>
+      <resource>
+        <directory>${project.build.directory}/generated-resources</directory>
+        <filtering>true</filtering>
+      </resource>
+    </resources>
+    <testResources>
+      <testResource>
+        <directory>${basedir}/src/test/resources</directory>
+      </testResource>
+      <testResource>
+        <directory>${project.build.directory}/generated-resources</directory>
+        <filtering>true</filtering>
+      </testResource>
+    </testResources>
     <plugins>
       <plugin>
         <groupId>org.scala-tools</groupId>
           <scmCommentPrefix/>
         </configuration>
       </plugin>
+      <!-- Redmine maven plugin -->
       <plugin>
         <groupId>org.nuiton.jredmine</groupId>
         <artifactId>maven-jredmine-plugin</artifactId>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.9</version>
         <configuration>
           <useFile>false</useFile>
           <reportFormat>plain</reportFormat>
         </configuration>
       </plugin>
+      <!-- Shared resources -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>unpack-shared-resources</id>
+            <goals>
+              <goal>unpack-dependencies</goal>
+            </goals>
+            <phase>generate-resources</phase>
+            <configuration>
+              <outputDirectory>${project.build.directory}/generated-resources
+              </outputDirectory>
+              <includeArtifactIds>shared</includeArtifactIds>
+              <includeGroupIds>gr.grnet.aquarium</includeGroupIds>
+              <excludeTransitive>true</excludeTransitive>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
   <!--Sub projects-->
diff --git a/shared/src/main/resources/META-INF/orm.xml b/shared/src/main/resources/META-INF/orm.xml
deleted file mode 100644 (file)
index f294307..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
-        http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" version="1.0">
-
-  <package>gr.grnet.aquarium.model</package>
-
-
-</entity-mappings>
index 253d98e..475cd26 100644 (file)
@@ -4,7 +4,6 @@
      http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
              version="1.0">
 
-
   <persistence-unit name="aquarium" transaction-type="RESOURCE_LOCAL">
 
     <class>gr.grnet.aquarium.model.Entity</class>
     <class>gr.grnet.aquarium.model.Bill</class>
 
     <properties>
-
-      <!--<property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.H2Platform"/>
-    <property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
-    <property name="javax.persistence.jdbc.url" value="jdbc:h2:database"/>
-    <property name="javax.persistence.jdbc.password" value=""/>
-    <property name="javax.persistence.jdbc.user" value="scott"/>-->
-
-      <property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.MySQLPlatform"/>
-      <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
-      <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/aquarium"/>
+      <property name="eclipselink.target-database"
+                value="org.eclipse.persistence.platform.database.MySQLPlatform"/>
+      <property name="javax.persistence.jdbc.driver"
+                value="com.mysql.jdbc.Driver"/>
+      <property name="javax.persistence.jdbc.url"
+                value="jdbc:mysql://localhost/aquarium"/>
       <property name="javax.persistence.jdbc.password" value="aquarium"/>
       <property name="javax.persistence.jdbc.user" value="aquarium"/>
 
index da61e71..8d2a2ff 100644 (file)
@@ -1,2 +1 @@
-This Readme is included in ${project.artifactId}-
-${project.version}.${project.packaging}
+The resources in this directory are copied to all generated jars.
\ No newline at end of file