We define shared values as <property> elements in a parent POM and use
them in child POMs. We have fragments like this, near the top of the
parent POM:
. . .
<properties>
. . .
<uimaj-ee-version>0.7.0</uimaj-version>
<uimaj-ee-release-version>${uimaj-version}-incubating-SNAPSHOT</uimaj-release-version>
. . .
<version>0.7.0-incubating-SNAPSHOT</version>
I noticed I might be able to replace the
<version>0.7.0-incubating-SNAPSHOT</version>
with
<version>${uimaj-ee-release-version}</version>
This only kind of worked. The way it would fail, would be if there
were no existing versions of the parent POM in any repository, then the
"mvn install" command for the parent POM would fail when scanning the
child POMs, saying, for example:
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID:
org.apache.uima:uimaj-ee-core:jar:${uimaj-ee-release-version}
Reason: Cannot find parent: org.apache.uima:uimaj-ee for project:
org.apache.uima:uimaj-ee-core:jar:${uimaj-ee-release-version} for
project org.apache.uima:uimaj-ee-core:jar:${uimaj-ee-release-version}
I found (as a workaround) that if I modified the parent POM to have no
children (commenting out the <module> elements), then mvn install for
the parent POM would run; furthermore, I could then uncomment out the
<module> children and mvn install on the parent POM would now build the
children OK (I guess because the parent POM was findable in the local
repository).
This problem doesn't seem to occur if the parent POM doesn't use
substitutable property values for its own <version> number. In that
case the parent POM need not be previously installed in the local
repository.
Is this expected behavior in Maven, or is this a defect?
-Marshall
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]