You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by 刘勇坡 <li...@gmail.com> on 2011/01/18 04:17:35 UTC

problem when upgrading from maven2 to maven3

Dear all maven developers,
    I have a project which was build by maven2, It always works well when
build or package it using maven2. But it came out a build error after i
upgraded maven from maven2 to maven3. The main error message is :it can't
find a special method in a class. Aware of collision of different version
jars, I find the project have
two related dependencies, one is A, another is B. There are a class C with
the same name, but the class C in B provide method m, which is not provided
by the class C in A.
    I run the command mvn dependency:tree. In the dependency tree, I saw
that the project dependents A and B directly. I moved declaration of B
before A, but it made no difference. other way, A and B are necessary,
neither of them is permitted to remove.
    Can you tell me what I can do? and why a project work with maven2 well
can't not be build with maven3?

best regards

yours sincerely Yongpo Liu

Re: problem when upgrading from maven2 to maven3

Posted by Jeff Jensen <je...@upstairstechnology.com>.
I encountered similar problem when upgrading from M2 to M3.  The cause
was 2 different versions of Hibernate jars on the classpath.  It seems
M3's transitive dependency resolution is more inclusive (more
accurate?!).  You may need to exclude a transitive dep (or drop use of
an unnecessary dep).  For conflicts like that, the offending dep's POM
config sometimes benefit from scope adjusting, perhaps to "optional",
to prevent same problem for others.


On Tue, Jan 18, 2011 at 3:07 AM, Marc Rohlfs <po...@googlemail.com> wrote:
> See the Maven 3 compatibility note on dependency resolution:
> https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html#Maven3.xCompatibilityNotes-DependencyResolution.
> It suggests to inspect the dependency tree that is printed when running
> Maven in debug mode.
>
> On 18/01/11 04:17, 刘勇坡 wrote:
>>
>>     Can you tell me what I can do? and why a project work with maven2 well
>> can't not be build with maven3?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: problem when upgrading from maven2 to maven3

Posted by Marc Rohlfs <po...@googlemail.com>.
See the Maven 3 compatibility note on dependency resolution: 
https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html#Maven3.xCompatibilityNotes-DependencyResolution. 
It suggests to inspect the dependency tree that is printed when running 
Maven in debug mode.

On 18/01/11 04:17, 刘勇坡 wrote:
>      Can you tell me what I can do? and why a project work with maven2 well
> can't not be build with maven3?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org