views:

96

answers:

3

I mean is there any difference between the maven you download and manually install/run from the one eclipse has embedded as an eclipse plugin? The reason why I ask is that, my project builds successfully in eclipse, but I get this annoying error when building from console mvn install, here is the error

Reason: Cannot find parent: net.oauth:oauth-parent for pro core....

I can fix this by manually removing parent tags from oauth pom and one other pom .. and it will build successfully, is there something else I can do to fix this? what could be the problem with console? When the time to build a project comes it will be from console not from eclipse .. thank you

EDIT

Is there a way to say maven .. ok just ignore those errors and continue with the build, cause that is obviously what eclipse is doing since there is no parent-oauth-project on the repository when the build succeeds with eclipse.

A: 

The Eclipse plugin will resolve dependencies from the workspace, so if you have a project with the Maven ID net.oauth:oauth-parent in the workspace, the plugin will use it.

The command line Maven just searches your local repository.

The solution for your bug is to run mvn install in the oauth-parent project to install the artifact in your local repository. Note that you must do this every time you change the parent project!

Aaron Digulla
@Aaron Digulla the net.oauth:oauth-parent is not a project or a sub-project(module), its just a jar that my project uses for authentication.. so when I run mvn install I run in on the parent pom .. and I have 6 sub modules .. and they all run/build on eclipse just fine .. is there a way I can do what eclipse does, can I do that run install from my parent pom xml? during some phase to fire that command or ?
c0mrade
@Aaron Digulla can I simulate what that eclipse does, can I specify some goal to be executed some times for that dependencies to be resolved? can I do anything beside manually doing something?
c0mrade
@Aaron Digulla the thing is that `oauth-parent` is not on repository, but the build still succeeds from eclipse, maybe its ignoring some errors .. or whatever .. is there anything I could do to ignore it or whatever just to make project build ?
c0mrade
@Aaron Digulla this is obviously beyond yours and mine scope of knowledge .. I think only one who could perhaps answer this question is @Pascal Thivent .. no hard feelings ..
c0mrade
Can you please edit your question and add the whole error message and the relevant part of your pom.xml (the oauth dependency)?
Aaron Digulla
I'm a bit wary what you mean by "its just a jar that my project uses for authentication". How do you include it in your project? Maven dependency? As a JAR with the Eclipse build properties?
Aaron Digulla
A: 

They can be different. You can verify under which maven version you run with the --version goal.

kukudas
+2  A: 

While it is possible to add an external maven install and thus to use the same version for the build inside Eclipse and on the command line, there might be differences for dependency resolution as mentioned in the note shown below:

alt text

So, if the versions differ, one can imagine to have slight differences in the behavior (but I'd be extremely surprised to be honest).

The problem here is that it's not possible to reproduce your problem as you didn't post your POM (or at least the relevant parts, i.e. the "culprit" dependency and the repository it comes from).

So please, update your question :)

Pascal Thivent