|
From: Bill B. <bb...@re...> - 2008-07-08 12:31:42
|
Martin Algesten wrote: > 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. Yeah, I'm a real maven noob and really struggled with it at first. 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. > This sounds good. I'm hoping you and Ryan can work out the best Maven structure and teach me a few things about maven in the process :) > 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. > If you haven't already guessed I'm not a big fan of logging in general. -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |