You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Wendy Smoak <ws...@gmail.com> on 2010/03/19 16:13:00 UTC

Re: Creating repository for offline building with dependency:go-offline fails

On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <jm...@gmail.com> wrote:
> My Maven project needs to be built in an offline computer. I am trying to
> create a snapshot of my repository using an online machine and mvn
> dependency:go-offline, and then move this snapshot repository to the offline
> machine and build there.

A local repository does not have the same metadata as a remote
repository.  Plugins especially are very picky about metadata.

Check the list archives, there was some discussion in times past about
a script to modify the metadata of a local repo so it would work as a
remote one.

The easier solution by far will be to run a repository manager locally
and let it proxy everything you need, then move *that* repository
(which will have the correct format) off to the other machine.

-- 
Wendy

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


Re: Creating repository for offline building with dependency:go-offline fails

Posted by Kathryn Huxtable <ka...@kathrynhuxtable.org>.
On Mar 19, 2010, at 10:13 AM, Wendy Smoak wrote:

> On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <jm...@gmail.com> wrote:
>> My Maven project needs to be built in an offline computer. I am trying to
>> create a snapshot of my repository using an online machine and mvn
>> dependency:go-offline, and then move this snapshot repository to the offline
>> machine and build there.
> 
> A local repository does not have the same metadata as a remote
> repository.  Plugins especially are very picky about metadata.
> 
> Check the list archives, there was some discussion in times past about
> a script to modify the metadata of a local repo so it would work as a
> remote one.
> 
> The easier solution by far will be to run a repository manager locally
> and let it proxy everything you need, then move *that* repository
> (which will have the correct format) off to the other machine.

I will second what Wendy said, and also say that the free version of Nexus is incredibly easy to set up, manage, and use.

I hope the Sonatype people are making money, because they deserve to. They've made a real quality product.

-K


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


Re: Creating repository for offline building with dependency:go-offline fails

Posted by Stephen Connolly <st...@gmail.com>.
Your best bet is to do as follows.

Set up a clean Nexus MRM (or any of the other MRMs) caching central

Blow away your local repo

Do a full clean build

Now you can take the central cache that Nexus MRM has built and that is a
valid remote repository... and nexus will have cleaned up the remote
metadata for you as well

On 22 March 2010 08:37, napple fabble <jm...@gmail.com> wrote:

>
> OK, I'm starting to get it. And you cannot a copy of your local repository
> as
> a "remote repository" by defining it with  <repositories><repository> since
> the metadata is different?
>

Correct


>
> I could still take the copy of local repository and just copy it to the
> place where local repository should be in the offline computer, and it
> should work, no?
>

Correct

>
> It just fails because dependency:go.offline has a bug and does not fully do
> what you described. It misses maven-surefire-plugin. I guess most won't
> notice this since they already have the surefire plugin in their local
> repository before dependecy:go-offline.
>
>
Correct


>
>
> stephenconnolly wrote:
> >
> > To make sure that everything you need is in your local repository before
> > you
> > unplug your network cable and step on a plane
> >
> > On 19 March 2010 16:01, napple fabble <jm...@gmail.com> wrote:
> >
> >>
> >>
> >> Wendy Smoak wrote:
> >> >
> >> > On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <jm...@gmail.com>
> >> > wrote:
> >> >> My Maven project needs to be built in an offline computer. I am
> trying
> >> to
> >> >> create a snapshot of my repository using an online machine and mvn
> >> >> dependency:go-offline, and then move this snapshot repository to the
> >> >> offline
> >> >> machine and build there.
> >> >
> >> > A local repository does not have the same metadata as a remote
> >> > repository.  Plugins especially are very picky about metadata.
> >> >
> >> > Check the list archives, there was some discussion in times past about
> >> > a script to modify the metadata of a local repo so it would work as a
> >> > remote one.
> >> >
> >> > The easier solution by far will be to run a repository manager locally
> >> > and let it proxy everything you need, then move *that* repository
> >> > (which will have the correct format) off to the other machine.
> >> >
> >> > --
> >> > Wendy
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> > For additional commands, e-mail: users-help@maven.apache.org
> >> >
> >> >
> >> >
> >>
> >>
> >> I am sure you know your stuff, but this does not make sense to me. Why
> >> does
> >> dependency:go-offline exist if you cannot use it for this purpose? Isn't
> >> it
> >> there to make offline builds possible? What is it used for if it does
> not
> >> work in this scenario?
> >>
> >> Is
> >>
> >>
> http://stubbisms.wordpress.com/2008/08/28/maven-is-to-ant-as-a-nail-gun-is-to-hammer-and-nails-you-need-to-move-on/
> >> wrong ("Taking Maven completely Off-Line")?
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://n2.nabble.com/Creating-repository-for-offline-building-with-dependency-go-offline-fails-tp4763428p4763867.html
> >> Sent from the maven users mailing list archive at Nabble.com.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://n2.nabble.com/Creating-repository-for-offline-building-with-dependency-go-offline-fails-tp4763428p4776734.html
> Sent from the maven users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Creating repository for offline building with dependency:go-offline fails

Posted by Stephen Connolly <st...@gmail.com>.
On 22 March 2010 09:15, napple fabble <jm...@gmail.com> wrote:

>
> Tested a little further. I
>
> 1. cleared my local repository
> 2. did mvn package
> 3. did mvn dependency:go-offline
> 4. went offline
> 5. moved my local repo to elsewhere (c:\repo\offline-repo-5). My local repo
> is completely empty now
> 6. added "repository" and "pluginRepository" configuration to my pom.xml,
> pointing to the previously created offline repo folder:
>
>        <repositories>
>                <repository>
>                        <releases />
>                        <id>offline-repository</id>
>                         <name>local offline build libs</name>
>                        <url>file:///c:/repo/offline-repo-5/</url>
>                </repository>
>        </repositories>
>
> - build works now. So based on this I would disagree on the "metadata is
> different" reason preventing from using this approach.
>

The local metadata will bite you in the ass when you least expect it.... you
have been warned


>
> The problem is that dependency:go-offline is pretty much useless. If you
> now
> do mvn clean for example, the clean plugin is not loaded and build fails.
> You would need to execute at least mvn clean, mvn package, maybe mvn deploy
> (even more? cannot say...) lifecycles to ensure all the needed plugins for
> offline building are available. dependency:go-offline does not help you
> with
> those at all. I again don't see the point of dependency:go-offline. You
> cannot trust it to get your needed plugin dependencies, you can (and need
> to) do what it is trying to do by executing mvn clean, mvn package...
> manually before going offline, so what does it accomplish? Why not just do
> mvn package before going offline?
>
>
>
>
> napple fabble wrote:
> >
> > OK, I'm starting to get it. And you cannot a copy of your local
> repository
> > as a "remote repository" by defining it with  <repositories><repository>
> > since the metadata is different?
> >
> > I could still take the copy of local repository and just copy it to the
> > place where local repository should be in the offline computer, and it
> > should work, no?
> >
> > It just fails because dependency:go.offline has a bug and does not fully
> > do what you described. It misses maven-surefire-plugin. I guess most
> won't
> > notice this since they already have the surefire plugin in their local
> > repository before dependecy:go-offline.
> >
> >
> >
> > stephenconnolly wrote:
> >>
> >> To make sure that everything you need is in your local repository before
> >> you
> >> unplug your network cable and step on a plane
> >>
> >> On 19 March 2010 16:01, napple fabble <jm...@gmail.com> wrote:
> >>
> >>>
> >>>
> >>> Wendy Smoak wrote:
> >>> >
> >>> > On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <jm.postilista@gmail.com
> >
> >>> > wrote:
> >>> >> My Maven project needs to be built in an offline computer. I am
> >>> trying
> >>> to
> >>> >> create a snapshot of my repository using an online machine and mvn
> >>> >> dependency:go-offline, and then move this snapshot repository to the
> >>> >> offline
> >>> >> machine and build there.
> >>> >
> >>> > A local repository does not have the same metadata as a remote
> >>> > repository.  Plugins especially are very picky about metadata.
> >>> >
> >>> > Check the list archives, there was some discussion in times past
> about
> >>> > a script to modify the metadata of a local repo so it would work as a
> >>> > remote one.
> >>> >
> >>> > The easier solution by far will be to run a repository manager
> locally
> >>> > and let it proxy everything you need, then move *that* repository
> >>> > (which will have the correct format) off to the other machine.
> >>> >
> >>> > --
> >>> > Wendy
> >>> >
> >>> > ---------------------------------------------------------------------
> >>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> > For additional commands, e-mail: users-help@maven.apache.org
> >>> >
> >>> >
> >>> >
> >>>
> >>>
> >>> I am sure you know your stuff, but this does not make sense to me. Why
> >>> does
> >>> dependency:go-offline exist if you cannot use it for this purpose?
> Isn't
> >>> it
> >>> there to make offline builds possible? What is it used for if it does
> >>> not
> >>> work in this scenario?
> >>>
> >>> Is
> >>>
> >>>
> http://stubbisms.wordpress.com/2008/08/28/maven-is-to-ant-as-a-nail-gun-is-to-hammer-and-nails-you-need-to-move-on/
> >>> wrong ("Taking Maven completely Off-Line")?
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>>
> http://n2.nabble.com/Creating-repository-for-offline-building-with-dependency-go-offline-fails-tp4763428p4763867.html
> >>> Sent from the maven users mailing list archive at Nabble.com.
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://n2.nabble.com/Creating-repository-for-offline-building-with-dependency-go-offline-fails-tp4763428p4776848.html
> Sent from the maven users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Creating repository for offline building with dependency:go-offline fails

Posted by napple fabble <jm...@gmail.com>.
Tested a little further. I 

1. cleared my local repository
2. did mvn package
3. did mvn dependency:go-offline 
4. went offline
5. moved my local repo to elsewhere (c:\repo\offline-repo-5). My local repo
is completely empty now
6. added "repository" and "pluginRepository" configuration to my pom.xml,
pointing to the previously created offline repo folder:

        <repositories>
		<repository>
			<releases />
			<id>offline-repository</id>
			<name>local offline build libs</name>
			<url>file:///c:/repo/offline-repo-5/</url>
		</repository>
	</repositories>

- build works now. So based on this I would disagree on the "metadata is
different" reason preventing from using this approach.

The problem is that dependency:go-offline is pretty much useless. If you now
do mvn clean for example, the clean plugin is not loaded and build fails.
You would need to execute at least mvn clean, mvn package, maybe mvn deploy
(even more? cannot say...) lifecycles to ensure all the needed plugins for
offline building are available. dependency:go-offline does not help you with
those at all. I again don't see the point of dependency:go-offline. You
cannot trust it to get your needed plugin dependencies, you can (and need
to) do what it is trying to do by executing mvn clean, mvn package...
manually before going offline, so what does it accomplish? Why not just do
mvn package before going offline?




napple fabble wrote:
> 
> OK, I'm starting to get it. And you cannot a copy of your local repository
> as a "remote repository" by defining it with  <repositories><repository>
> since the metadata is different?
> 
> I could still take the copy of local repository and just copy it to the
> place where local repository should be in the offline computer, and it
> should work, no?
> 
> It just fails because dependency:go.offline has a bug and does not fully
> do what you described. It misses maven-surefire-plugin. I guess most won't
> notice this since they already have the surefire plugin in their local
> repository before dependecy:go-offline.
> 
> 
> 
> stephenconnolly wrote:
>> 
>> To make sure that everything you need is in your local repository before
>> you
>> unplug your network cable and step on a plane
>> 
>> On 19 March 2010 16:01, napple fabble <jm...@gmail.com> wrote:
>> 
>>>
>>>
>>> Wendy Smoak wrote:
>>> >
>>> > On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <jm...@gmail.com>
>>> > wrote:
>>> >> My Maven project needs to be built in an offline computer. I am
>>> trying
>>> to
>>> >> create a snapshot of my repository using an online machine and mvn
>>> >> dependency:go-offline, and then move this snapshot repository to the
>>> >> offline
>>> >> machine and build there.
>>> >
>>> > A local repository does not have the same metadata as a remote
>>> > repository.  Plugins especially are very picky about metadata.
>>> >
>>> > Check the list archives, there was some discussion in times past about
>>> > a script to modify the metadata of a local repo so it would work as a
>>> > remote one.
>>> >
>>> > The easier solution by far will be to run a repository manager locally
>>> > and let it proxy everything you need, then move *that* repository
>>> > (which will have the correct format) off to the other machine.
>>> >
>>> > --
>>> > Wendy
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> > For additional commands, e-mail: users-help@maven.apache.org
>>> >
>>> >
>>> >
>>>
>>>
>>> I am sure you know your stuff, but this does not make sense to me. Why
>>> does
>>> dependency:go-offline exist if you cannot use it for this purpose? Isn't
>>> it
>>> there to make offline builds possible? What is it used for if it does
>>> not
>>> work in this scenario?
>>>
>>> Is
>>>
>>> http://stubbisms.wordpress.com/2008/08/28/maven-is-to-ant-as-a-nail-gun-is-to-hammer-and-nails-you-need-to-move-on/
>>> wrong ("Taking Maven completely Off-Line")?
>>>
>>>
>>> --
>>> View this message in context:
>>> http://n2.nabble.com/Creating-repository-for-offline-building-with-dependency-go-offline-fails-tp4763428p4763867.html
>>> Sent from the maven users mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>> 
>> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/Creating-repository-for-offline-building-with-dependency-go-offline-fails-tp4763428p4776848.html
Sent from the maven users mailing list archive at Nabble.com.

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


Re: Creating repository for offline building with dependency:go-offline fails

Posted by napple fabble <jm...@gmail.com>.
OK, I'm starting to get it. And you cannot a copy of your local repository as
a "remote repository" by defining it with  <repositories><repository> since
the metadata is different?

I could still take the copy of local repository and just copy it to the
place where local repository should be in the offline computer, and it
should work, no?

It just fails because dependency:go.offline has a bug and does not fully do
what you described. It misses maven-surefire-plugin. I guess most won't
notice this since they already have the surefire plugin in their local
repository before dependecy:go-offline.



stephenconnolly wrote:
> 
> To make sure that everything you need is in your local repository before
> you
> unplug your network cable and step on a plane
> 
> On 19 March 2010 16:01, napple fabble <jm...@gmail.com> wrote:
> 
>>
>>
>> Wendy Smoak wrote:
>> >
>> > On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <jm...@gmail.com>
>> > wrote:
>> >> My Maven project needs to be built in an offline computer. I am trying
>> to
>> >> create a snapshot of my repository using an online machine and mvn
>> >> dependency:go-offline, and then move this snapshot repository to the
>> >> offline
>> >> machine and build there.
>> >
>> > A local repository does not have the same metadata as a remote
>> > repository.  Plugins especially are very picky about metadata.
>> >
>> > Check the list archives, there was some discussion in times past about
>> > a script to modify the metadata of a local repo so it would work as a
>> > remote one.
>> >
>> > The easier solution by far will be to run a repository manager locally
>> > and let it proxy everything you need, then move *that* repository
>> > (which will have the correct format) off to the other machine.
>> >
>> > --
>> > Wendy
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: users-help@maven.apache.org
>> >
>> >
>> >
>>
>>
>> I am sure you know your stuff, but this does not make sense to me. Why
>> does
>> dependency:go-offline exist if you cannot use it for this purpose? Isn't
>> it
>> there to make offline builds possible? What is it used for if it does not
>> work in this scenario?
>>
>> Is
>>
>> http://stubbisms.wordpress.com/2008/08/28/maven-is-to-ant-as-a-nail-gun-is-to-hammer-and-nails-you-need-to-move-on/
>> wrong ("Taking Maven completely Off-Line")?
>>
>>
>> --
>> View this message in context:
>> http://n2.nabble.com/Creating-repository-for-offline-building-with-dependency-go-offline-fails-tp4763428p4763867.html
>> Sent from the maven users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://n2.nabble.com/Creating-repository-for-offline-building-with-dependency-go-offline-fails-tp4763428p4776734.html
Sent from the maven users mailing list archive at Nabble.com.

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


Re: Creating repository for offline building with dependency:go-offline fails

Posted by Stephen Connolly <st...@gmail.com>.
To make sure that everything you need is in your local repository before you
unplug your network cable and step on a plane

On 19 March 2010 16:01, napple fabble <jm...@gmail.com> wrote:

>
>
> Wendy Smoak wrote:
> >
> > On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <jm...@gmail.com>
> > wrote:
> >> My Maven project needs to be built in an offline computer. I am trying
> to
> >> create a snapshot of my repository using an online machine and mvn
> >> dependency:go-offline, and then move this snapshot repository to the
> >> offline
> >> machine and build there.
> >
> > A local repository does not have the same metadata as a remote
> > repository.  Plugins especially are very picky about metadata.
> >
> > Check the list archives, there was some discussion in times past about
> > a script to modify the metadata of a local repo so it would work as a
> > remote one.
> >
> > The easier solution by far will be to run a repository manager locally
> > and let it proxy everything you need, then move *that* repository
> > (which will have the correct format) off to the other machine.
> >
> > --
> > Wendy
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
>
>
> I am sure you know your stuff, but this does not make sense to me. Why does
> dependency:go-offline exist if you cannot use it for this purpose? Isn't it
> there to make offline builds possible? What is it used for if it does not
> work in this scenario?
>
> Is
>
> http://stubbisms.wordpress.com/2008/08/28/maven-is-to-ant-as-a-nail-gun-is-to-hammer-and-nails-you-need-to-move-on/
> wrong ("Taking Maven completely Off-Line")?
>
>
> --
> View this message in context:
> http://n2.nabble.com/Creating-repository-for-offline-building-with-dependency-go-offline-fails-tp4763428p4763867.html
> Sent from the maven users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Creating repository for offline building with dependency:go-offline fails

Posted by napple fabble <jm...@gmail.com>.

Wendy Smoak wrote:
> 
> On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <jm...@gmail.com>
> wrote:
>> My Maven project needs to be built in an offline computer. I am trying to
>> create a snapshot of my repository using an online machine and mvn
>> dependency:go-offline, and then move this snapshot repository to the
>> offline
>> machine and build there.
> 
> A local repository does not have the same metadata as a remote
> repository.  Plugins especially are very picky about metadata.
> 
> Check the list archives, there was some discussion in times past about
> a script to modify the metadata of a local repo so it would work as a
> remote one.
> 
> The easier solution by far will be to run a repository manager locally
> and let it proxy everything you need, then move *that* repository
> (which will have the correct format) off to the other machine.
> 
> -- 
> Wendy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 


I am sure you know your stuff, but this does not make sense to me. Why does
dependency:go-offline exist if you cannot use it for this purpose? Isn't it
there to make offline builds possible? What is it used for if it does not
work in this scenario?

Is
http://stubbisms.wordpress.com/2008/08/28/maven-is-to-ant-as-a-nail-gun-is-to-hammer-and-nails-you-need-to-move-on/
wrong ("Taking Maven completely Off-Line")?


-- 
View this message in context: http://n2.nabble.com/Creating-repository-for-offline-building-with-dependency-go-offline-fails-tp4763428p4763867.html
Sent from the maven users mailing list archive at Nabble.com.

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