[jboss-dev] Why Maven sucks (part 1)

Paul Gier pgier at redhat.com
Mon Apr 21 14:47:30 EDT 2008


Carlo de Wolf wrote:
> Paul Gier wrote:
>> Carlo de Wolf wrote:
>>
>>>
>>> Now if it was a tool focussed on dependency management (like Ivy) it 
>>> would have solved the real problem: snapshots. So let's do an example:
>>> - as trunk -> ejb3-core-0.1-SNAPSHOT -> 
>>> ejb3-interceptors-0.13-0-SNAPSHOT -> aop-2.1-SNAPSHOT (for the example)
>>> If I happen to deploy a new snapshot of aop, it'll break AS build. 
>>> Why: ejb3-core is not compatible and Maven blindly loads it up. This 
>>> is not possible in Ivy, it's snapshot repository looks like:
>>> - as trunk -> ejb3-core-0.1-20080421 -> 
>>> ejb3-interceptors-0.13.0-20080421 -> aop-2.1-20080420.
>>> If I happen to deploy a new snapshot of aop you get and I run a 
>>> nightly build on ejb3 you get:
>>> - as trunk -> ejb3-core-0.1-20080421 -> 
>>> ejb3-interceptors-0.13.0-20080421 -> aop-2.1-20080420
>>> - ejb3-interceptors-0.13-0-20080422 -> aop-2.1-20080422
>>> Since ejb3-core didn't properly build there is no new snapshot for it 
>>> and AS build is unaffected.
>>> Combine this with unit tests and you got a pretty stable setup.
>>>
>>
>> We can do this using maven also.  If you want to tie the build to a 
>> specific snapshot, just put the full snapshot version in the 
>> dependency.  So for example, ejb3-interceptors you could put version 
>> "0.13.0-20080417.210958-18".  And maven will keep using that snapshot 
>> build until you change the dependency.  The -SNAPSHOT convention is 
>> just for convenience if you just want to build with the latest until a 
>> release comes out.
> 
> It must be automated. Whenever someone does a mvn deploy, the pom.xml 
> should be replaced by one not containing any snapshots, but only full 
> versions.
> 

Just so it's clear what you are asking for, you want dependencies with 
(-SNAPSHOT) to be replaced with the specific snapshot version (-timstamp-build) 
during deployment?  I could probably add this as an option to the deploy plugin, 
but I don't know if this would solve the problem.

Just as an example, let's say you deploy an ejb3 module that has a dependency on 
jboss-aop.  You deploy and it resolves to aop snapshot build 9.  The app server 
has a dependency on the current aop snapshot (2.0-SNAPSHOT) and they both point 
to build 9 so all is fine.  Then aop deploys a new snapshot (build number 10). 
The app server depends on aop (-SNAPSHOT) so it gets the new version.  Now the 
app server wants build 10, but ejb3 wants snapshot version 9.  The app server 
IMO should win because the direct dependency should take priority over the 
transitive ejb dependency.  To solve this issue you would still have to change 
the app server dependency to tie it to the specific snapshot of aop.






More information about the jboss-development mailing list