File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven Repo Location

 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I have a couple of Maven repo's defined in my pom.xml as below:


I added a new dependency to Struts 2.1.7 and the build simply failed saying that it was not able to find the jar or the pom in http://maven.jahia.org/maven2/com/jhlabs/imaging/01012005 location. Why the heck is this?
 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even worse is that Maven does not even look into my local repository where I already have most of the jars.... Why is this behavior?
 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Which jar does the following maven error refers to?



Is it the velocity 1.6.2? If yes, then I have it already in my local repo and why does Maven not look for it over there?
 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What the heck is this? Why would this http://repository.springsource.com/maven/bundles/release pull up an error page? Am I ages behind with Maven?
 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just because of this reason, I had to manually download the jars. I did so for the Struts libraries and when building my project, got the following warning:

[WARNING] The POM for org.apache.struts:struts2-core:jar:2.2.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.struts:struts2-tiles-plugin:jar:2.2.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.struts:struts2-spring-plugin:jar:2.2.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.jhlabs:imaging:jar:01012005 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details

Which repo location should I add so that these jars and poms are automatically detected and downloaded? Is it the Maven central?
 
Pranav Raulkar
Ranch Hand
Posts: 73
Android Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joe,
Thats one hell of a POM! So many repositories Looking at your pom, most of the jars are already in default maven repo. What I'll suggest is you remove all the repository locations from your pom first and try building. Maven will use its default repository which has a "lot" of things including struts jars in your case, and ideally should suffice all your needs. If thats not enough then add the repositories in your pom. As per the maven location, I think you know where to look. If not http://repo1.maven.org/maven2/ redirects to http://search.maven.org/#browse where you can search for struts jars. Hope this helps.
 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What the *?3$ is this? I'm tring to build the simplest of the Maven project which just has one dependency top Spring 3.0.5-RELEASE and it complains that it cannot find the jar?



 
Pranav Raulkar
Ranch Hand
Posts: 73
Android Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I did some checking which and heres what I found.

In version 3, Spring no longer provides the all-in-one Spring jar! The spring.jar artifact that contained almost the entire framework is no longer provided.
You can confirm this by browsing the spring tree in maven repo http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.springframework%22
So now you'll have to specifically tell maven what part of the spring framework you need as follows -
where ${artifactId} may be any one from the artifact id column from url above ex. spring-webmvc. You'll have to list all that you use.
 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know that since 3.x.x, Spring jars are much modularized. But the point here is my Maven build does not even download any jars that it finds in the Maven central repository. I double checked my internet connection and it is perfectly fine.
 
Pranav Raulkar
Ranch Hand
Posts: 73
Android Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about proxy?
Also note that problems may even arise if you are using another repo and it requires authentication, you'll need to provide it in settings.xml in .m2 folder (local repo)
Even after this problem still persists, obvious doubts would be on pom.
 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not have any repo location defined in my pom.xml or in my settings xml. This really baffles me.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic