aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Build project from the Local Repository instead of Remote Repository Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Build project from the Local Repository instead of Remote Repository" Watch "Build project from the Local Repository instead of Remote Repository" New topic
Author

Build project from the Local Repository instead of Remote Repository

Kunal Bhatia
Greenhorn

Joined: Aug 28, 2009
Posts: 11
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

Joined: Jul 20, 2005
Posts: 10096
    
164

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.

[My Blog] [JavaRanch Journal]
Kunal Bhatia
Greenhorn

Joined: Aug 28, 2009
Posts: 11
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

Joined: Jun 24, 2003
Posts: 3274
    
    5

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?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Kunal Bhatia
Greenhorn

Joined: Aug 28, 2009
Posts: 11
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

Joined: Jun 24, 2003
Posts: 3274
    
    5

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

Joined: Aug 28, 2009
Posts: 11
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

Joined: Sep 29, 2008
Posts: 12617

What is this? And is the double-period a typo?

location: class com..model.sdo.impl.login.ForgottenUserNameSDOImpl
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Build project from the Local Repository instead of Remote Repository