Hi Ivan,

Maven will decide the version which is nearest to the root.
Yes we have the cycle dependency here.

I just filled a JIRA[1], I will commit your patch to fix it.

Thanks for point it out.

[1] https://issues.apache.org/activemq/browse/CAMEL-1182

Willem

Ivan Dubrov wrote:
> Willem Jiang wrote:
>> Hi,
>>
>> org.apache.activemq:activemq-camel:jar:5.2.0 depends on camel 1.5.0.
>> So we don't have the cycle dependency in camel-jms.
>>   
> I think, Maven choses 1.5.1-SNAPSHOT instead of 1.5.0 for some reason.
> The  mvn dependency:resolve (from the campaign/camel-jms) has the
> following line in the output:
> 
> [INFO]    org.apache.camel:camel-jms:jar:1.5.1-SNAPSHOT:test
> 
>> Did you build the camel 1.5.x branch from the root ?
>>   
> 
> Yes, I build it from the root.
> 
> The problem disappears if I have camel-jms:1.5.1-SNAPSHOT in my local
> Maven repository (so if I add exclusion, install the camel-jms to the
> repository and then remove the exclusion -- the build works). It does
> not work when I build it and I have no camel-jms:1.5.1-SNAPSHOT in the
> local repo.
> 
> Looking at these lines in the failed output:
> 
> 1) org.apache.camel:camel-jms:bundle:1.5.1-SNAPSHOT
> 2) org.apache.activemq:activemq-camel:jar:5.2.0
> 3) org.apache.camel:camel-jms:jar:1.5.1-SNAPSHOT
> 
> 
> It seems to me the that problem is "bundle" in 1) line vs "jar" in 3)
> line, so Maven thinks that these two are different and does not fulfill
> the 1.5.1-SNAPSHOT dependency from the reactor. As a result, it tries to
> get it from the repository.
> 
> You can try removing camel-jms from the local Maven2 repository and try
> building the project to reproduce the issue.
>> Willem
>>
>> Ivan Dubrov wrote:
>>   
>>> Hi,
>>>
>>> Currently Apache Camel 1.5.x branch could not be built in a clean
>>> environment. The build fails with
>>>
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [ERROR] BUILD ERROR
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] Failed to resolve artifact.
>>>
>>> Missing:
>>> ----------
>>> 1) org.apache.camel:camel-jms:jar:1.5.1-SNAPSHOT
>>>
>>>   Try downloading the file manually from the project website.
>>>
>>>   Then, install it using the command:
>>>       mvn install:install-file -DgroupId=org.apache.camel
>>> -DartifactId=camel-jms -Dversion=1.5.1-SNAPSHOT -Dpackaging=jar
>>> -Dfile=/path/to/file
>>>
>>>   Alternatively, if you host your own repository you can deploy the file
>>> there:
>>>       mvn deploy:deploy-file -DgroupId=org.apache.camel
>>> -DartifactId=camel-jms -Dversion=1.5.1-SNAPSHOT -Dpackaging=jar
>>> -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
>>>
>>>   Path to dependency:
>>>       1) org.apache.camel:camel-jms:bundle:1.5.1-SNAPSHOT
>>>       2) org.apache.activemq:activemq-camel:jar:5.2.0
>>>       3) org.apache.camel:camel-jms:jar:1.5.1-SNAPSHOT
>>>
>>> ----------
>>> 1 required artifact is missing.
>>>
>>> for artifact:
>>>   org.apache.camel:camel-jms:bundle:1.5.1-SNAPSHOT
>>>
>>> from the specified remote repositories:
>>>   apache.snapshots (http://people.apache.org/repo/m2-snapshot-repository),
>>>   guiceyfruit.release
>>> (http://guiceyfruit.googlecode.com/svn/repo/releases/),
>>>   central (http://repo1.maven.org/maven2)
>>>
>>>
>>> The workaround is to add an exclusion to the activemq-camel dependency
>>> in the camel-jms component pom.xml:
>>>
>>>
>>>     <dependency>
>>>       <groupId>org.apache.activemq</groupId>
>>>       <artifactId>activemq-camel</artifactId>
>>>       <scope>test</scope>
>>>       <exclusions>
>>>         <exclusion>
>>>           <groupId>org.springframework</groupId>
>>>           <artifactId>spring</artifactId>
>>>         </exclusion>
>>>       </exclusions>
>>>     </dependency>
>>>
>>>
>>> Should I create JIRA issue for this?
>>>
>>>     
>>
>>   
> 
> 

Reply via email to