• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Build project from the Local Repository instead of Remote Repository

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

Iam new to maven, therefore was having some configuration problems.
I have configured the pom.xml file and a settings.xml file in .m2/settings.xml. My requirement is that Once the local repository is made, I want to build the project from the local repository, if the dependency is not present in the local repo, it should then download from the http://repo1.maven.com...or the remote repository is.

Please help me with this.Would be looking for some response

Thanks
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually that's how Maven works. It first checks your local repository and if the dependency is missing in your local repository, only then it tries to download it from the remote repository.
 
Kunal Bhatia
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Jaikiran,

Thank you for your support,

I could understand the point that maven itself sees the local repo first and the goes to the remote repo...ok

but when write the command mvn install on my project then it always goes to the remote site for downloading..is it that i have to use mvn compile ..mvn -o compile for this.

Also,
As my prject til now uses around 50 jars (approx)..so do i have too add all the jars dependecy in my pom.xml or what do i have to do..Please help in this as soon as possible.

Thank You.
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maven should only download the artifact the first time, have you checked your local repo to make sure the JAR files you want are in there?
 
Kunal Bhatia
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Martijn,

Thanks for your reply.It is working now. it was some jars missing in the local repo.
Onwe more thing while building the project, Iam getting "cannot find symbol" error

This is failing to build the project an in turn creating a compilation failure.

Please help in this
 
Martijn Verburg
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably need to double check the versions of the JARs that you have referenced in your poms vs the the versions you're really wanting to run against. That error usually occurs when you're building against the wrong version of a lib.
 
Kunal Bhatia
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Martijn ,

Thanks for your reply.I will check the versions.
Also I am have to deploy the same on tomcat for which I did the following


Iam using the command mvn tomcat:deploy
Thanks in advance
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is this? And is the double-period a typo?

location: class com..model.sdo.impl.login.ForgottenUserNameSDOImpl
 
A magnificient life is loaded with tough challenges. En garde tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic