aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven Repo Location Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven Repo Location" Watch "Maven Repo Location" New topic
Author

Maven Repo Location

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

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?


SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

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

Joined: Sep 26, 2006
Posts: 9243
    
    1

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

Joined: Sep 26, 2006
Posts: 9243
    
    1

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

Joined: Sep 26, 2006
Posts: 9243
    
    1

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

Joined: Apr 20, 2011
Posts: 73

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

Joined: Sep 26, 2006
Posts: 9243
    
    1

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

Joined: Apr 20, 2011
Posts: 73

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

Joined: Sep 26, 2006
Posts: 9243
    
    1

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

Joined: Apr 20, 2011
Posts: 73

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

Joined: Sep 26, 2006
Posts: 9243
    
    1

I do not have any repo location defined in my pom.xml or in my settings xml. This really baffles me.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maven Repo Location
 
Similar Threads
FATAL ERROR:The PluginDescriptor for the plugin Plugin [org.jvnet.jaxb2.maven2:mavenjaxb2-plugin]
Maven Project Build Successfully but Error While Test It
Why is Eclipse/Maven project not picking up the values from settings.xml?
Maven: Trouble loading a dependency from a local repository
Multiple Repositorys in Maven