In our Maven project, we are trying to create the following directory structure (about 80 projects in total, only some of them are shown so that you get this idea):
myappli (pom)
...
Note. This is a flat structure for Maven, since all non-leaf projects have a packagingpom value . (cf BetterBuildsWithMaven book).
We define the dependency versions in the " dependencyManagement" in " myappli" pom. It works great.
Our problem is reusing the dependencies themselves . For example, ejb dependencies are common to all ejb projects (by design). We do not want to cut-paste and support all this with every change!
" " ejb ejb . :
- Maven "
parent pom" , , . - Maven ( dependencyManagement)
XML- . pom, ,
"Reason: Parse error reading POM. Reason: could not resolve entity named 'ejbDependencies'":
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project [
<!ENTITY ejbDependencies SYSTEM "./ejbDependencies.txt">
]>
<project ...
...
&ejbDependencies;
...
. , , - .
ejb, . (mvn compile), , javax.ejb .
. "mvn install" .
:
<project ...>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.company</groupId>
<artifactId>myproj-maven</artifactId>
<version>3.1-SNAPSHOT</version>
</parent>
<groupId>com.company</groupId>
<artifactId>myproj-maven-ejb</artifactId>
<version>${myproj-version}</version>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>ejb</artifactId>
</dependency>
<dependency>
<groupId>ojdbc</groupId>
<artifactId>ojdbc</artifactId>
</dependency>
</dependencies>
</project>
---------------------------------
<project ...>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.company</groupId>
<artifactId>myproj-identite-ejb</artifactId>
<version>3.1-SNAPSHOT</version>
</parent>
<groupId>com.company</groupId>
<artifactId>myproj-identite-metier</artifactId>
<name>SNR IDENTITE METIER</name>
<version>2.0.1</version>
<packaging>ejb</packaging>
<dependencies>
<dependency>
<groupId>com.company</groupId>
<artifactId>myproj-maven-ejb</artifactId>
<version>${myproj-version}</version>
<type>pom</type>
</dependency>
</dependencies>
</project>
, - , , .
Maven, maven, maven.
.
+
| \
+
| +
| | \
Edited
, , . Maven, : - (
Maven. . , , !