|
From: Martin A. <sp...@ma...> - 2008-07-08 11:21:42
|
In parent pom.xml we define:
<properties>
<resteasy.version>1.0-beta-6</resteasy.version>
</properties>
- and this property is then used wherever the version is needed.
Superficially this may look like it works, but it won't. The maven
pom.xml often exist outside a context where the property definition
will work. For my local test project I have dependency on the child
project such as:
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>1.0-beta-6</version>
</dependency>
And I don't define <resteasy.version> anywhere. This results in:
Downloading: http://repo1.maven.org/maven2//org/jboss/resteasy/resteasy-jaxrs-all/$
{resteasy.version}/resteasy-jaxrs-all-${resteasy.version}.pom
...
and eventually an error that it can't find the dependency.
The reason this works in the /examples is that the exact property
<resteasy.version> has been defined there as well, hence maven
resolves it - but we can't require every project linking to resteasy
to define this property.
The solution is unfortunately to duplicate the version of the parent
pom around endlessly - however this is where the release plugin I
talked about earlier comes in handy. If we can get the project to work
with that plugin, it will help us maintain/update these versions as we
move forward.
I've refactored the pom versions to use the standard maven behaviour
of inheriting parent pom version and use ${project.version} for
relationships between child modules - so for now releasing means
editing the parent versions manually.
Happy to work on the release plugin if you agree this is the way
forward.
Btw I also made sl4j-log4j dependency optional since I hate log4j with
a passion, and depending on resteasy currently pulled that crud into
my project.
M
|