• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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.
 
Marshal
Posts: 22450
121
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
Marshal
Posts: 22450
121
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".
reply
    Bookmark Topic Watch Topic
  • New Topic