tony1223 / run-jetty-run

Automatically exported from code.google.com/p/run-jetty-run
0 stars 0 forks source link

RJR get wrong classpath in M2Eclipse #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

M2E Maven Container will solve the pom , 
if the dependency project exist in workspace ,
maven will consider it as a project classpath and solve all the lib in the 
project.

But actully it should not be.

for example

project A{ //the web proejct.
     pom{
          depenedency{ projectB, artifactA-2.0 }
     }
}

projectB{
     pom{
          depenedency{ artifactA-1.0 }        
     }
     lib{
         xxx.jar
     }
}

If you run the projectA with RJR, 
the maven container will solve projectB as a project classpath entry.

and it will load  artifactA-1.0.jar / xxx.jar when you run RJR with A.

But actully in A project , it should not expect to load the xxx.jar since the 
pom file didn't mention it , and that caused error.

Original issue reported on code.google.com by tonylovejava on 14 Mar 2011 at 1:50

GoogleCodeExporter commented 9 years ago
Ready since 2011/3/14 , committed in r78 ,
This one will help a lot of Maven user with RJR.

And now we are ready for 1.2.1 :)

Original comment by tonylovejava on 14 Mar 2011 at 4:14

GoogleCodeExporter commented 9 years ago

Original comment by tonylovejava on 14 Mar 2011 at 4:14

GoogleCodeExporter commented 9 years ago
For more description about the fix.

After a deep tracing with M2E and StandardClasspathProvider,
I rewrote the resolveClasspath to handle a special case for project classpath 
entry in maven container ( built in M2Eclipse).

commit r78 

I user two generically method for determining the project nature and classpath 
entry container's name to check if it's a maven proejct ,
so user *have not to* install M2E when they use RJR, and they could still work 
on it correctly after they install M2E.

After fixing this , the maven optional dependency is working well.

Original comment by tonylovejava on 14 Mar 2011 at 3:06