On 21/04/2011 7:48 PM, Zhao Binbin wrote:
There're project A and many other projects A1, A2 ... A10. A is the parent
of all other A[n] projects.. I used a property<project.version> in all the
pom files so when I need to change the version number, I only need to change
it in A's pom.xml. Actually it works well.
Why is this a good idea?
It seems to imply that all modules have changes in them at once and need
new version numbers without actually thinking about what this means.
We have 70+ modules and it is still worth taking an hour or so to go
through the projects as a team to understand what modules will change to
upgrade the version. Not every new release requires a new version of
every module.
I would be concerned that an unthinking change to versions without
actually thinking about the impact of the new functionality is an
invitation to sloppy thinking and reduced ability to scope the update.
We stopped renumbering releases of modules that did not need to be
changed or recompiled.
Obviously major version changes do require a change in all modules but
is only takes a few seconds to update the pom in each project.
This is not significant in the overall effort and at least one knows
that a new version of a project has received some human attention.
It may also be tied to SVN changes that need to be done to branch and
tag the module if required.
Ron
pom.xml of A
<artifactId>A</artifactId>
<version>${project.version}</version>
<packaging>pom</packaging>
<modules>
<module>A1</module>
<module>A2</module>
<module>A3</module>
</modules>
<properties>
<project.version>2.0</project.version>
</properties>
pom.xml of A1:
<parent>
<artifactId>A1</artifactId>
<relativePath>../pom.xml</relativePath>
<version>${project.version}</version>
</parent>
I have another project B, which depends on A1.
<dependency>
<artifactId>A1</artifactId>
<version>2.0</version>
</dependency>
To build B:
1) in directory of A, run mvn clean install, it succeeds, and all jars are
installed to local repository.
2) in directory of B, run mvn clean package. it fails with messages:
[INFO]
------------------------------------------------------------------------
[INFO] Building B
[INFO]
------------------------------------------------------------------------
Downloading:
http://repo1.maven.org/maven2/com/.../.../.../${project.version}/A-${project.version}.pom
[INFO]
------------------------------------------------------------------------
Actually jar file of A1 is already ready at local repository at xxx/2.0/
Why maven just pickup the jar file and compile? It seems trying to parse the
A1's pom.xml and doesn't understand project.version.
Anyone got any ideas?
I'm stuck at this for weeks. For some reasons I cannot change the pom files
of A, A1. How to write B's project to build successfully?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org