I am having some trouble with the Release Plug-In, and I am wondering if
anyone out there might have some thoughts on what the problem is.
Here is my setup:
parent-app
|
|-- pom.xml
|
|-- child-module-A
| |-- pom.xml
| |-- src
| |-- ...
|
|-- child-module-B
| |
| |-- pom.xml
| |
| |-- grandchild-module-B1
| | |
| | |-pom.xml
| | |-src
| | |-...
| |
| |-- grandchild-module-B2
| |
| |- ...
|
|-- child-module-C
|-- pom.xml
|-- src
|-- ...
etc...
The nested modules go at most two levels deep as shown above. Within
the parent-app POM, I specify a project version, say 1.0-SNAPSHOT, and
all child (and grandchild) modules inherit that version using POM
inheritance via the <parent> tag. Likewise, I have a
<dependencyManagement> section in the parent-app POM that sets the
version dependencies for all modules (many of the modules are
inter-dependent on each other) to ${project.version}. So, parent-app,
all the modules, and all inter-dependent module dependencies are set to
the same version, ${project.version}, which would be 1.0-SNAPSHOT.
Everything builds fine using the command > mvn clean package goal. The
problems start when I try to cut a release using the command > mvn
release:prepare. The problem is that during release preparation Maven
goes in and takes out the SNAPSHOT in the parent-app POM. Now, when the
> clean integration-test goal is executed during release preparation,
Maven cannot find the dependencies. Maven is looking for a version 1.0
dependency and not a 1.0-SNAPSHOT dependency, but none of the 1.0
modules have been deployed to any repository (local or our company
repository). Thus, I get an error that looks something like this:
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
<Details on missing artifacts omitted ...>
----------
2 required artifacts are missing.
How do I get Maven to either (1) deploy a 1.0 module to the repository
during release preparation, or (2) properly resolve the location of the
newly created 1.0 modules within the project directory structure during
release preparation? I would think I want option (2) since I don't want
anything deployed until I know the release is good to go. Is the
solution simply that my child modules cannot have any inter-dependence?
Perhaps I am misunderstanding something fundamental, but if someone can
point out what I am doing wrong so that I can get this working, it would
be much appreciated.
Regards,
Chris Marth
Lockheed Martin IS&SS
[EMAIL PROTECTED]