Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Local Repository SnapShot

 
Ranch Hand
Posts: 127
2
Monad Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just created a SnapShot and installed it on my local repository and now what? I can see it in my ~/.m2/repository folder but how do I use in my next maven project?

I want to call mvn archetype:generate and use my new SnapShot there but I'm not sure how to add it and import it into App.java.

Need some simple guidance. Hopefully simple.
 
Sheriff
Posts: 22124
114
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anything that's available in your local repository can be added as a dependency in your Maven project, as if it were available for everyone. Just remember that any project using the dependency cannot be built by others that don't have the dependency.
 
Gerard Gauthier
Ranch Hand
Posts: 127
2
Monad Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Spoor wrote:... Just remember that any project using the dependency cannot be built by others that don't have the dependency.



So basically(since the dependency is local) I can only build I it on my machine. Right?

I kind of figured out how dependencies work by exploring my ~/.m2 folder and the pom.xml's dependency section.



I just walked into my ./m2 folder using the tags for junit as steps.
 
Rob Spoor
Sheriff
Posts: 22124
114
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gerard Gauthier wrote:

Rob Spoor wrote:... Just remember that any project using the dependency cannot be built by others that don't have the dependency.



So basically(since the dependency is local) I can only build I it on my machine. Right?


Right.

I kind of figured out how dependencies work by exploring my ~/.m2 folder and the pom.xml's dependency section.



I just walked into my ./m2 folder using the tags for junit as steps.


It's probably a good idea to read Introduction to the Dependency Mechanism at least once. It tells you some more about scopes etc.

I'd like to point you to https://search.maven.org/ and https://mvnrepository.com/. They both let you do the same thing (find available dependencies and their versions), which one to use is purely personal preference. I prefer the second, even though the first one is more "official".
 
My cellmate was this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic