File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Concurrent access of maven 1/2 repo 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 "Concurrent access of maven 1/2 repo" Watch "Concurrent access of maven 1/2 repo" New topic
Author

Concurrent access of maven 1/2 repo

Dharmesh Patel
Greenhorn

Joined: Aug 20, 2008
Posts: 3
Our project requires access to maven 1 and 2 repositories since some of use 1 and others use 2.

Is there a way to access/ write a POM in maven 2 to access the dependancies/ jars from maven 1 (v3) and 2 (v4) both?

Any ideas?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9963
    
163

"D P"

Please check your private message for a message from JavaRanch.


[My Blog] [JavaRanch Journal]
Anadi Misra
Ranch Hand

Joined: Jun 03, 2008
Posts: 69
Hi,

Are both these repositories "internal"(hosted in your environment) to your project users or you are using the public repositories?


Anadi Mishra.
Dharmesh Patel
Greenhorn

Joined: Aug 20, 2008
Posts: 3
Originally posted by Anadi Misra:
Hi,

Are both these repositories "internal"(hosted in your environment) to your project users or you are using the public repositories?


Hi Anadi,

There is http://repo1.maven.org/maven/ and http://repo1.xyz.com/java-maven1/repo

I have some of the jars need to access from xyz (maven 1 v3) and some of from maven central (repo1.maven 2 v4).

Firstly I need to look up my projects (xyz) server repository (which is bulit on maven 1). If not available, pull it from maven 2 central repository.

I am searching - how to access maven 1.x repository in maven 2 projects. The hint that i have is:
http://maven.apache.org/guides/mini/guide-using-m1-repos-with-m2.html

I wonder how to write pom dependancies to access maven 1 and 2 both.

Hope my objective is clear to you.

Regards
Dharmesh
Anadi Misra
Ranch Hand

Joined: Jun 03, 2008
Posts: 69
Hi,

Firstly I need to look up my projects (xyz) server repository (which is bulit on maven 1). If not available, pull it from maven 2 central repository.


The link has the configuration for older repositories I see, but I am not sure on how to configue any kind of specific order of preference for repositries lookup; something like looking up in repo1 first and then repo2 like you mentioned.

It might be worth-while upgrading to a maven repository manager like Archiva or Nexus which can act as your local mirror for both Maven1 and Maven2 repos.
Dharmesh Patel
Greenhorn

Joined: Aug 20, 2008
Posts: 3
Finally i got to access maven 1 repository in maven 2 projects. The thing here is: we need to put group id and artifact id same since maven 1 is not having artifiact id. put the version number that you need to pull from. It creates poms structure to access maven 1.x repo (need to add repository as snapshot (true) and type = legacy.

Hope this helps.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Concurrent access of maven 1/2 repo
 
Similar Threads
Maven src and netbeans
How to mavenize a project
could not find goal 'download' in plugin org.apache.maven.plugins
From Maven1/CVS to Maven2/ClearCase
maven 2: How can I avoid hard-coding my username in my pom.xml, scm configuration?