You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gajo Csaba <cs...@cosylab.com> on 2009/12/15 14:03:19 UTC

How to download every dependency we need at once?

Hello,

We have a problem that some computers are not connected to the internet, 
so Maven cannot download dependencies from there. Because of this, by 
default, maven is running in offline mode.

Currently, Maven is set up by an installation script, which installs 
maven and does some changes to its settings.xml etc. During setup, an 
internet connection does exist. The idea is to change this script, so 
that once everything is set up, it would run several maven commands, 
like "mvn clean", "mvn deploy" etc. to force Maven to download all 
necessary files into the local .m2 directory.

Is there some cleaner way to do this? I know exactly which dependencies 
are needed (it's a large list), so is there some maven command to not 
build anything, just download these dependencies into the local .m2 
directory?

Thanks, Csaba


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


Re: How to download every dependency we need at once?

Posted by ert_nutler <jm...@hotmail.com>.
I have a similar arrangement and would love to see your commands if you can
post them.  Thanks in advance. 
-- 
View this message in context: http://n2.nabble.com/How-to-download-every-dependency-we-need-at-once-tp4169797p4511059.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: How to download every dependency we need at once?

Posted by John Patrick <nh...@gmail.com>.
I work in a sandbox network and have similar issues.

What I do:
1) Internet Connected Host
1.1) Create pom contain all dependencies and plugins used.
1.2) mvn -s settings.xml clean install site
1.3) find, grep -v, sort -u, echo, cat sort -u, echo (obtain list of group
id's downloaded)
1.4) rsync list generated in 1.3
1.5) diff latest rsync with representation of offline repo
1.6) generate diff file, usually a tar.gz
1.7) update representation of offline repo with contents of step 1.6
1.8) burn step 1.6 to disk

2) Standalone Network Host
2.1) same as step 1.7, update repo with contents contained in step 1.6
2.2) Do a full build from the repo updated in step 2.1 to confirm it still
works.

3) Handling updates
3.1) update pom created in step 1.1 or manually update list in step 1.3
3.2) repeat step 1 and 2 when required to download the latest update and
dependencies, sometimes it takes a few attempts to fix all dependencies.

I've worked with offline maven development for a few years and usually I'm
the one managing the repo and it my best solution at this moment.

If you want to commands i execute let me know and I'll post them.

John

2009/12/16 Anders Hammar <an...@hammar.net>

> Why not use a corporate repository manager like Nexus or Artifactory? All
> users would then configure their Maven to use that as the remote repo for
> all artifacts. This will give you a central point where you manage all
> artifacts, including both external and internal ones. His instance would
> then proxy any remote repos on Internet (if you allow it too).
>
> Any other solution is a hack.
>
> /Anders
>
> On Tue, Dec 15, 2009 at 14:19, Gajo Csaba <cs...@cosylab.com> wrote:
>
> > This seems to be almost perfect except it requires a project to exist.
> But
> > I'll use it if there's nothing else :)
> >
> > Thanks, Csaba
> >
> >
> >
> > Jesse Farinacci wrote:
> >
> >> Hi Gajo,
> >>
> >> 2009/12/15 Gajo Csaba <cs...@cosylab.com>:
> >>
> >>
> >>> Is there some cleaner way to do this? I know exactly which dependencies
> >>> are
> >>> needed (it's a large list), so is there some maven command to not build
> >>> anything, just download these dependencies into the local .m2
> directory?
> >>>
> >>>
> >>>
> >>
> >> Check out the maven-dependency-plugin:go-offline goal:
> >>
> >>
> >>
> http://maven.apache.org/plugins/maven-dependency-plugin/go-offline-mojo.html
> >>
> >> -Jesse Farinacci
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: How to download every dependency we need at once?

Posted by David Hoffer <dh...@gmail.com>.
+1

I wouldn't use maven without one, doesn't matter if I have 1 developer or
1000.

-Dave

On Thu, Feb 4, 2010 at 7:17 AM, Baptiste MATHUS <ml...@batmat.net> wrote:

> 2009/12/16 Anders Hammar <an...@hammar.net>
>
> > Why not use a corporate repository manager like Nexus or Artifactory*?*
> >  [...]
> > * Any other solution is a hack*.
> >
>
> +1.
>
> Most of the time, users do not consider installing a repository manager
> because they think it's complicated.
> Please trust us: it's not, it's very simple.
>
> At least, it's far far less complicated than the huge list of commands
> given
> by John... Installing a mrm can only be a big win for you.
>
> Cheers.
>

Re: How to download every dependency we need at once?

Posted by Baptiste MATHUS <ml...@batmat.net>.
2009/12/16 Anders Hammar <an...@hammar.net>

> Why not use a corporate repository manager like Nexus or Artifactory*?*
>  [...]
> * Any other solution is a hack*.
>

+1.

Most of the time, users do not consider installing a repository manager
because they think it's complicated.
Please trust us: it's not, it's very simple.

At least, it's far far less complicated than the huge list of commands given
by John... Installing a mrm can only be a big win for you.

Cheers.

Re: How to download every dependency we need at once?

Posted by Anders Hammar <an...@hammar.net>.
Why not use a corporate repository manager like Nexus or Artifactory? All
users would then configure their Maven to use that as the remote repo for
all artifacts. This will give you a central point where you manage all
artifacts, including both external and internal ones. His instance would
then proxy any remote repos on Internet (if you allow it too).

Any other solution is a hack.

/Anders

On Tue, Dec 15, 2009 at 14:19, Gajo Csaba <cs...@cosylab.com> wrote:

> This seems to be almost perfect except it requires a project to exist. But
> I'll use it if there's nothing else :)
>
> Thanks, Csaba
>
>
>
> Jesse Farinacci wrote:
>
>> Hi Gajo,
>>
>> 2009/12/15 Gajo Csaba <cs...@cosylab.com>:
>>
>>
>>> Is there some cleaner way to do this? I know exactly which dependencies
>>> are
>>> needed (it's a large list), so is there some maven command to not build
>>> anything, just download these dependencies into the local .m2 directory?
>>>
>>>
>>>
>>
>> Check out the maven-dependency-plugin:go-offline goal:
>>
>>
>> http://maven.apache.org/plugins/maven-dependency-plugin/go-offline-mojo.html
>>
>> -Jesse Farinacci
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to download every dependency we need at once?

Posted by Gajo Csaba <cs...@cosylab.com>.
This seems to be almost perfect except it requires a project to exist. 
But I'll use it if there's nothing else :)

Thanks, Csaba


Jesse Farinacci wrote:
> Hi Gajo,
>
> 2009/12/15 Gajo Csaba <cs...@cosylab.com>:
>   
>> Is there some cleaner way to do this? I know exactly which dependencies are
>> needed (it's a large list), so is there some maven command to not build
>> anything, just download these dependencies into the local .m2 directory?
>>
>>     
>
> Check out the maven-dependency-plugin:go-offline goal:
>
> http://maven.apache.org/plugins/maven-dependency-plugin/go-offline-mojo.html
>
> -Jesse Farinacci
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>   


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


Re: How to download every dependency we need at once?

Posted by Jesse Farinacci <ji...@gmail.com>.
Hi Gajo,

2009/12/15 Gajo Csaba <cs...@cosylab.com>:
>
> Is there some cleaner way to do this? I know exactly which dependencies are
> needed (it's a large list), so is there some maven command to not build
> anything, just download these dependencies into the local .m2 directory?
>

Check out the maven-dependency-plugin:go-offline goal:

http://maven.apache.org/plugins/maven-dependency-plugin/go-offline-mojo.html

-Jesse Farinacci

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