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

Concurrent access of maven 1/2 repo

 
Dharmesh Patel
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"D P"

Please check your private message for a message from JavaRanch.
 
Anadi Misra
Ranch Hand
Posts: 69
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Are both these repositories "internal"(hosted in your environment) to your project users or you are using the public repositories?
 
Dharmesh Patel
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 69
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic