You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Levin, Ilya" <il...@hp.com> on 2012/11/20 12:39:45 UTC

local repository problem

Hi,

My problem is this.
I want my maven project to take the artifacts only from the local repository.
The first mvn run is a regular one so that all artifact could be downloaded to the local repository.
The second run is with flag -o (maven offline) . and it is in fact works - maven uses only the cache.

So in that case it's logical to think that if running offline, I can REMOVE the repository name from my main pom (since all the artifact are cached).
BUT the minute I do that (and still running  with flag -o) maven throws this at me:
Unable to find artifact. The repository system is offline but the artifact <some artifact> is not available in the local repository.

and of course the artifact is there. When I return back the repository name to the pom, again it works.
So why do I need the repository name in the pom if running offline?

Thanks for the help.
ilya


Android Maven Plugin 3.4.1 released

Posted by Manfred Moser <ma...@mosabuam.com>.
The Android Maven Plugin team is pleased to announce the release of
version 3.4.1 of the plugin.

New features/bug fixes are

- apklib now uses the resourceOverlayDirectories and
resourceOverlayDirectory options
- Showing current test count and number of total count of tests during
instrumentation test runs
 - Adapted Manifest merging to Android SDK release 21
- Fixed parsing of android.test.packages for multiple comma separated
packages names to test
- Parse return value of installPackage() during deploy and report failure
as build failure with error message instead of ignoring it

When upgrading please ensure to check the change log for further details:

http://code.google.com/p/maven-android-plugin/wiki/Changelog

We would like to thank the contributors to this release for their valuable
help and invite you all to help us out as well:

We would like to thank the following contributors for their awesome work.

Tim Hepner https://github.com/mithepner
Aleksander Pyszny http://www.alan-systems.com/en
Tom Bollwitt https://github.com/tlbollwitt
Nic Strong http://www.codepoets.co.nz
Manfred Moser http://www.simpligility.com

Documentation, issue tracker and more can be found on the plugin website at

http://code.google.com/p/maven-android-plugin/

For a primer to use the plugin check out the Android Development chapter
in Maven: The Complete Reference

http://www.sonatype.com/books/mvnref-book/reference/android-dev.html

Please join the Maven Android Mailing List for relevant discussions:

https://groups.google.com/forum/?fromgroups#!forum/maven-android-developers

Enjoy

Manfred Moser
http://www.simpligility.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: local repository problem

Posted by Thomas Matthijs <li...@selckin.be>.
You can cheat to get around this, use at your own risk

# find ~/.m2/repository/ -name _maven.repositories -delete

I do this all the time because i swap my settings.xml to my company's
mirrior-all nexus and then back to normal one without mirrors for open
source projects etc.

Or like, if you want to get at a dependency that is not yet in the mirror
to have a quick look if it does want you want, but need
internal artifact to do the test, you would remove mirror-all from the
settings.xml, so you can download the new thing, but then you can't use any
internal artifacts, so you just run the cheat, and voila do your
evaluation. Beats messing around with jar files and manual classpaths



On Tue, Nov 20, 2012 at 12:57 PM, Anders Hammar <an...@hammar.net> wrote:

> First of all, could you enlighten us why you're doing what you're doing? It
> looks to me that your just making things difficult which will get you into
> trouble. Maven is designed to work with repositories. If you don't like
> that then Maven is probably not the tool for you.
>
> Secondly, you can never remove all the repos from your build. The super-pom
> declares central as a repo and you can't remove that. So, there will always
> be at least one repo declared.
>
> To answer the question about the error you run into I believe it is because
> Maven 3.0.x keeps track of where an artifact has been downloaded from. So
> if you remove the repo, this might not match although the artifact *file*
> actually does exist in the local repo.
>
> But please, rethink your approach as you, IMHO, are looking for problems.
>
> /Anders
>
>
> On Tue, Nov 20, 2012 at 12:39 PM, Levin, Ilya <il...@hp.com> wrote:
>
> > Hi,
> >
> > My problem is this.
> > I want my maven project to take the artifacts only from the local
> > repository.
> > The first mvn run is a regular one so that all artifact could be
> > downloaded to the local repository.
> > The second run is with flag -o (maven offline) . and it is in fact works
> -
> > maven uses only the cache.
> >
> > So in that case it's logical to think that if running offline, I can
> > REMOVE the repository name from my main pom (since all the artifact are
> > cached).
> > BUT the minute I do that (and still running  with flag -o) maven throws
> > this at me:
> > Unable to find artifact. The repository system is offline but the
> artifact
> > <some artifact> is not available in the local repository.
> >
> > and of course the artifact is there. When I return back the repository
> > name to the pom, again it works.
> > So why do I need the repository name in the pom if running offline?
> >
> > Thanks for the help.
> > ilya
> >
> >
>

Re: local repository problem

Posted by Anders Hammar <an...@hammar.net>.
Ok. The simple solution would be to make this repo with your artifacts
available to him. Either through Internet access or by having him getting
access via a citrix client or similar (over VPN). This solution will solve
all future issues you will run into w/t having access to your internal
artifacts.

Other possible, but painful, solutions include:
* Create a zip will all artifacts and poms that also include a script that
install them to his/her local repo.
* Create a zip with the artifacts and poms in a maven 2 repo structure.
He/she could then host these locally and point his Maven environment to
this repo.

Just understand that these solution will bring you lots of work keeping his
environment in sync with your internal one.

/Anders


On Tue, Nov 20, 2012 at 1:13 PM, Levin, Ilya <il...@hp.com> wrote:

> Thanks for the reply, I should explain what I'm doing.
>
> When I run my project in the company network I have access to all the
> artifacts we create in our repository.
> When somebody OUTSIDE the company network runs the project he doesn’t have
> this privilege.
> Now, Since most of the artifacts we use are stable and doesn’t change, I
> want him to copy them to his
> Local repository, so that when he is running  maven, it will uses this
> (now "local")artifacts and central maven repository for other
> Artifacts he may use (3rd party etc...)
>
> Again thanks.
>
> -----Original Message-----
> From: anders.g.hammar@gmail.com [mailto:anders.g.hammar@gmail.com] On
> Behalf Of Anders Hammar
> Sent: יום ג 20 נובמבר 2012 13:57
> To: Maven Users List
> Subject: Re: local repository problem
>
> First of all, could you enlighten us why you're doing what you're doing?
> It looks to me that your just making things difficult which will get you
> into trouble. Maven is designed to work with repositories. If you don't
> like that then Maven is probably not the tool for you.
>
> Secondly, you can never remove all the repos from your build. The
> super-pom declares central as a repo and you can't remove that. So, there
> will always be at least one repo declared.
>
> To answer the question about the error you run into I believe it is
> because Maven 3.0.x keeps track of where an artifact has been downloaded
> from. So if you remove the repo, this might not match although the artifact
> *file* actually does exist in the local repo.
>
> But please, rethink your approach as you, IMHO, are looking for problems.
>
> /Anders
>
>
> On Tue, Nov 20, 2012 at 12:39 PM, Levin, Ilya <il...@hp.com> wrote:
>
> > Hi,
> >
> > My problem is this.
> > I want my maven project to take the artifacts only from the local
> > repository.
> > The first mvn run is a regular one so that all artifact could be
> > downloaded to the local repository.
> > The second run is with flag -o (maven offline) . and it is in fact
> > works - maven uses only the cache.
> >
> > So in that case it's logical to think that if running offline, I can
> > REMOVE the repository name from my main pom (since all the artifact
> > are cached).
> > BUT the minute I do that (and still running  with flag -o) maven
> > throws this at me:
> > Unable to find artifact. The repository system is offline but the
> > artifact <some artifact> is not available in the local repository.
> >
> > and of course the artifact is there. When I return back the repository
> > name to the pom, again it works.
> > So why do I need the repository name in the pom if running offline?
> >
> > Thanks for the help.
> > ilya
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: local repository problem

Posted by "Levin, Ilya" <il...@hp.com>.
Thanks for the reply, I should explain what I'm doing.

When I run my project in the company network I have access to all the artifacts we create in our repository.
When somebody OUTSIDE the company network runs the project he doesn’t have this privilege.
Now, Since most of the artifacts we use are stable and doesn’t change, I want him to copy them to his
Local repository, so that when he is running  maven, it will uses this (now "local")artifacts and central maven repository for other
Artifacts he may use (3rd party etc...)

Again thanks.

-----Original Message-----
From: anders.g.hammar@gmail.com [mailto:anders.g.hammar@gmail.com] On Behalf Of Anders Hammar
Sent: יום ג 20 נובמבר 2012 13:57
To: Maven Users List
Subject: Re: local repository problem

First of all, could you enlighten us why you're doing what you're doing? It looks to me that your just making things difficult which will get you into trouble. Maven is designed to work with repositories. If you don't like that then Maven is probably not the tool for you.

Secondly, you can never remove all the repos from your build. The super-pom declares central as a repo and you can't remove that. So, there will always be at least one repo declared.

To answer the question about the error you run into I believe it is because Maven 3.0.x keeps track of where an artifact has been downloaded from. So if you remove the repo, this might not match although the artifact *file* actually does exist in the local repo.

But please, rethink your approach as you, IMHO, are looking for problems.

/Anders


On Tue, Nov 20, 2012 at 12:39 PM, Levin, Ilya <il...@hp.com> wrote:

> Hi,
>
> My problem is this.
> I want my maven project to take the artifacts only from the local 
> repository.
> The first mvn run is a regular one so that all artifact could be 
> downloaded to the local repository.
> The second run is with flag -o (maven offline) . and it is in fact 
> works - maven uses only the cache.
>
> So in that case it's logical to think that if running offline, I can 
> REMOVE the repository name from my main pom (since all the artifact 
> are cached).
> BUT the minute I do that (and still running  with flag -o) maven 
> throws this at me:
> Unable to find artifact. The repository system is offline but the 
> artifact <some artifact> is not available in the local repository.
>
> and of course the artifact is there. When I return back the repository 
> name to the pom, again it works.
> So why do I need the repository name in the pom if running offline?
>
> Thanks for the help.
> ilya
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: local repository problem

Posted by Anders Hammar <an...@hammar.net>.
First of all, could you enlighten us why you're doing what you're doing? It
looks to me that your just making things difficult which will get you into
trouble. Maven is designed to work with repositories. If you don't like
that then Maven is probably not the tool for you.

Secondly, you can never remove all the repos from your build. The super-pom
declares central as a repo and you can't remove that. So, there will always
be at least one repo declared.

To answer the question about the error you run into I believe it is because
Maven 3.0.x keeps track of where an artifact has been downloaded from. So
if you remove the repo, this might not match although the artifact *file*
actually does exist in the local repo.

But please, rethink your approach as you, IMHO, are looking for problems.

/Anders


On Tue, Nov 20, 2012 at 12:39 PM, Levin, Ilya <il...@hp.com> wrote:

> Hi,
>
> My problem is this.
> I want my maven project to take the artifacts only from the local
> repository.
> The first mvn run is a regular one so that all artifact could be
> downloaded to the local repository.
> The second run is with flag -o (maven offline) . and it is in fact works -
> maven uses only the cache.
>
> So in that case it's logical to think that if running offline, I can
> REMOVE the repository name from my main pom (since all the artifact are
> cached).
> BUT the minute I do that (and still running  with flag -o) maven throws
> this at me:
> Unable to find artifact. The repository system is offline but the artifact
> <some artifact> is not available in the local repository.
>
> and of course the artifact is there. When I return back the repository
> name to the pom, again it works.
> So why do I need the repository name in the pom if running offline?
>
> Thanks for the help.
> ilya
>
>