aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven not downloading dependency for org.eclipse.persistence Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven not downloading dependency for org.eclipse.persistence" Watch "Maven not downloading dependency for org.eclipse.persistence" New topic
Author

Maven not downloading dependency for org.eclipse.persistence

Eric Lopez-Fernandez
Greenhorn

Joined: Oct 13, 2011
Posts: 17
Hey there,

I am having trouble with maven. I do have the following POM.xml file



And here is the error message I'm getting

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5:compile (default-compile) on project chapter02: Compilation failure: Compilation failure:
[ERROR] ~\05292012\src\main\java\Book.java:[3,0] package javax.persistence does not exist

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

It seems like maven was not able to download the dependency for org.eclipse.persistence

Has somebody had that problem before?

Any help will be greatly appreciated!
Eric
E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 892
    
    9
If mvn failed to download something you usually get an error message stating that fact. Are there any other error messages before the one you posted?
Eric Lopez-Fernandez
Greenhorn

Joined: Oct 13, 2011
Posts: 17
Thank you for your reply E Armitage!

That is the first error message. If I go to ~\.m2\repository I am not able to find anything related to org.eclipse.persistence, however I am able to find stuff related to maven-compiler-plugin

I was wondering if the problem is with the repository that I'm specifying or with the version number for the dependencies. Do you have any idea?
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1030
    
    5

I don't think that URL for the EclipseLink repo exists anymore.

Have you tried the repo at java.net instead?

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Try removing the <dependencyManagement> tags. That is, delete lines 13 and 42.

Because you are getting a compiler error, the problem you are having is not with downloading artifacts. Instead, the issue is that the compiler classpath doesn't include the JARs that you need. I think that the <dependencyManagement> tags are causing this, hence my suggestion to remove them. One way to check this is to use the -X option and observe what the compiler classpath gets set to.


JBoss In Action
Eric Lopez-Fernandez
Greenhorn

Joined: Oct 13, 2011
Posts: 17

The problem was fixed by removing the <dependencyManagement> tag. Somehow it was not allowing to download everything.

Thank YOU all for your help!
E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 892
    
    9
Eric Lopez-Fernandez wrote:
.. Somehow it was not allowing to download everything.

The explanation (which is always better than the solution) has already been given.
DependencyManagement doesn't state what your artifact depends on and so doesn't state what requires to be downloaded so no download was being done.
It specifies versions so that if you do add dependencies to your project then the project doesn't have to specify the versions since they are already in DependencyManagement.
When you add the actual dependencies the should not be under DependencyManagement.

Eric Lopez-Fernandez
Greenhorn

Joined: Oct 13, 2011
Posts: 17
Thank you very much for the explanation, I appreciate that!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maven not downloading dependency for org.eclipse.persistence