Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Local Repository SnapShot

 
Ranch Hand
Posts: 119
1
Monad Java Linux
  • Mark post as helpful
  • send pies
  • 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: 22014
108
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • 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: 119
1
Monad Java Linux
  • Mark post as helpful
  • send pies
  • 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: 22014
108
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • 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".
 
Hoo hoo hoo! Looks like we got a live one! Here, wave this tiny ad at it:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic