• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Maven 2 - disable dependency downloading

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my current project I'm using several JARs that aren't present neither on iBiblio nor in other remote repositories. I've installed them to my local repository, but each time I'm building my project Maven tries to download them from remote repositories. Is there an option to disable downloading these (and only these; there are still some others I need to be downloaded) dependencies from remote repositories?
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can just remove the dependency node on your jar in the pom.xml

<dependency>
<groupId>your_group</groupId>
<artifactId>your_jar</artifactId>
<version>your_jar_version</version>
<scope>the_scope</scope>
</dependency>
 
Tymur Porkuyan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, but isn't there a clearer way? If I remove these dependencies then the POM won't represent actual state of the project.
 
Elid OR
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This jar don't exist in any remote repositories but you want to use it in your project right ?

You can use local jar in dependency but it's not a best practice since that you have to create a remote repository for this jar. If you still want to do it :

Take a look at
http://maven.apache.org/ref/2.0.3-SNAPSHOT/maven-model/maven.html#class_dependency
and Check the propertie documentation for "systemPath".
 
Tymur Porkuyan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I understand now. Having separate repository for these jars seems logical enough. Is it possible to create a remote repository that is located on my machine like local repository, but is treated like remote one? I mean, without having to create an ftp server?
 
reply
    Bookmark Topic Watch Topic
  • New Topic