• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Maven not downloading dependency for org.eclipse.persistence

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think that URL for the EclipseLink repo exists anymore.

Have you tried the repo at java.net instead?

 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Eric Lopez-Fernandez
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for the explanation, I appreciate that!
 
If we don't do the shopping, we won't have anything for dinner. And I've invited this tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!