File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Build project from the Local Repository instead of Remote Repository

 
Kunal Bhatia
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is this? And is the double-period a typo?

location: class com..model.sdo.impl.login.ForgottenUserNameSDOImpl
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic