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

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

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

napple fabble
Please do not recommend setting up a local repository manager, I am aware of those but would like to try this approach.

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.

My approach is basically "Taking Maven completely Off-Line" from 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/

I can create the "offline repository" fine and it contains all my plugins and jar dependencies nicely. I move this for example to c:\repo\offline-repo-4\. For example maven-resources-plugin looks like:

C:\repo\offline-repo-4\org\apache\maven\plugins\maven-resources-plugin\2.3>dir
19.03.2010  16:33            21 348 maven-resources-plugin-2.3.jar
19.03.2010  16:33                40 maven-resources-plugin-2.3.jar.sha1
19.03.2010  16:33             4 683 maven-resources-plugin-2.3.pom
19.03.2010  16:33                40 maven-resources-plugin-2.3.pom.sha1

At step 7 I add the "offline repository" config to my pom.xml:

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

So, before attempting to build at step 8, my local "normal" repository at C:\Documents and Settings\myusername\.m2 is empty, I have this "offline repo" that should contain all that I need, and I have configured my pom.xml to use it. To simulate offline build properly, I disable network connection before building. Then if I try offline building:

D:\projects\zzz2>mvn package -offline
[INFO]
NOTE: Maven is executing in offline mode. Any artifacts not already in your local
repository will be inaccessible.

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building safProto - AppFramework Application
[INFO]    task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: org.apache.maven.plugins:maven-resources-plugin

Reason: POM 'org.apache.maven.plugins:maven-resources-plugin' not found in repository: System is offline.

  org.apache.maven.plugins:maven-resources-plugin:pom:2.3


 for project org.apache.maven.plugins:maven-resources-plugin


and if I try normal build without the -offline:

D:\projects\zzzz2>mvn package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building safProto - AppFramework Application
[INFO]    task-segment: [package]
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.3/maven-resources-plugin-2.3.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-resources-plugin:pom:2.3' from repository central (http://repo1.maven.org/maven2): Error transf
erring file: repo1.maven.org
Downloading: file:///c:/repo/offline-repo-4//org/apache/maven/plugins/maven-resources-plugin/2.3/maven-resources-plugin-2.3.pom
4K downloaded  (maven-resources-plugin-2.3.pom)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugins/12/maven-plugins-12.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-plugins:pom:12' from repository central (http://repo1.maven.org/maven2): Error transferring fil
e: repo1.maven.org
Downloading: file:///c:/repo/offline-repo-4//org/apache/maven/plugins/maven-plugins/12/maven-plugins-12.pom
11K downloaded  (maven-plugins-12.pom)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-parent/9/maven-parent-9.pom
[WARNING] Unable to get resource 'org.apache.maven:maven-parent:pom:9' from repository central (http://repo1.maven.org/maven2): Error transferring file: repo1.m
aven.org
Downloading: file:///c:/repo/offline-repo-4//org/apache/maven/maven-parent/9/maven-parent-9.pom
32K downloaded  (maven-parent-9.pom)
Downloading: http://repo1.maven.org/maven2/org/apache/apache/4/apache-4.pom
[WARNING] Unable to get resource 'org.apache:apache:pom:4' from repository central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org
Downloading: file:///c:/repo/offline-repo-4//org/apache/apache/4/apache-4.pom
4K downloaded  (apache-4.pom)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.3/maven-resources-plugin-2.3.jar
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.3' from repository central (http://repo1.maven.org/maven2): Err
or transferring file: repo1.maven.org
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] A required plugin was not found: Plugin could not be found - check that the goal name is correct: Unable to download the artifact from any repository

Try downloading the file manually from the project website.

Then, install it using the command:
    mvn install:install-file -DgroupId=org.apache.maven.plugins -DartifactId=maven-resources-plugin -Dversion=2.3 -Dpackaging=maven-plugin -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
    mvn deploy:deploy-file -DgroupId=org.apache.maven.plugins -DartifactId=maven-resources-plugin -Dversion=2.3 -Dpackaging=maven-plugin -Dfile=/path/to/file -D
url=[url] -DrepositoryId=[id]


  org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.3

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)


  org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.3

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

The latter creates to my "normal local repo" (C:\Documents and....) following:

C:\Documents and Settings\username\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.3>dir
19.03.2010  16:41             4 683 maven-resources-plugin-2.3.pom
19.03.2010  16:41                40 maven-resources-plugin-2.3.pom.sha1

So it seems Maven is able to get the pom and it's sha1 from the "offline repo" but for some reason does not fetch the jar from the same place.

What's going on here....I would like to understand?
Reply | Threaded
Open this post in threaded view
|

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

Maven User-3
I think you want to also say that this repository is a mirror of * as  
well.

Interesting concept...

On Mar 19, 2010, at 10:54 AM, jimmi4664 <[hidden email]> wrote:

>
> Please do not recommend setting up a local repository manager, I am  
> aware of
> those but would like to try this approach.
>
> 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.
>
> My approach is basically "Taking Maven completely Off-Line" from
> 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/
>
> I can create the "offline repository" fine and it contains all my  
> plugins
> and jar dependencies nicely. I move this for example to
> c:\repo\offline-repo-4\. For example maven-resources-plugin looks  
> like:
>
> C:\repo\offline-repo-4\org\apache\maven\plugins\maven-resources-
> plugin\2.3>dir
> 19.03.2010  16:33            21 348 maven-resources-plugin-2.3.jar
> 19.03.2010  16:33                40 maven-resources-
> plugin-2.3.jar.sha1
> 19.03.2010  16:33             4 683 maven-resources-plugin-2.3.pom
> 19.03.2010  16:33                40 maven-resources-
> plugin-2.3.pom.sha1
>
> At step 7 I add the "offline repository" config to my pom.xml:
>
>        <repositories>
>        <repository>
>            <releases />
>            <id>offline-repository</id>
>            <name>local offline build repo</name>
>            <url>file:///c:/repo/offline-repo-4/</url>
>        </repository>
>    </repositories>
>
> So, before attempting to build at step 8, my local "normal"  
> repository at
> C:\Documents and Settings\myusername\.m2 is empty, I have this  
> "offline
> repo" that should contain all that I need, and I have configured my  
> pom.xml
> to use it. To simulate offline build properly, I disable network  
> connection
> before building. Then if I try offline building:
>
> D:\projects\zzz2>mvn package -offline
> [INFO]
> NOTE: Maven is executing in offline mode. Any artifacts not already  
> in your
> local
> repository will be inaccessible.
>
> [INFO] Scanning for projects...
> [INFO]
> ---
> ---------------------------------------------------------------------
> [INFO] Building safProto - AppFramework Application
> [INFO]    task-segment: [package]
> [INFO]
> ---
> ---------------------------------------------------------------------
> [INFO]
> ---
> ---------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ---
> ---------------------------------------------------------------------
> [INFO] Error building POM (may not be this project's POM).
>
>
> Project ID: org.apache.maven.plugins:maven-resources-plugin
>
> Reason: POM 'org.apache.maven.plugins:maven-resources-plugin' not  
> found in
> repository: System is offline.
>
>  org.apache.maven.plugins:maven-resources-plugin:pom:2.3
>
>
> for project org.apache.maven.plugins:maven-resources-plugin
>
>
> and if I try normal build without the -offline:
>
> D:\projects\zzzz2>mvn package
> [INFO] Scanning for projects...
> [INFO]
> ---
> ---------------------------------------------------------------------
> [INFO] Building safProto - AppFramework Application
> [INFO]    task-segment: [package]
> [INFO]
> ---
> ---------------------------------------------------------------------
> Downloading:
> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.3/maven-resources-plugin-2.3.pom
> [WARNING] Unable to get resource
> 'org.apache.maven.plugins:maven-resources-plugin:pom:2.3' from  
> repository
> central (http://repo1.maven.org/maven2): Error transf
> erring file: repo1.maven.org
> Downloading:
> file:///c:/repo/offline-repo-4//org/apache/maven/plugins/maven-
> resources-plugin/2.3/maven-resources-plugin-2.3.pom
> 4K downloaded  (maven-resources-plugin-2.3.pom)
> Downloading:
> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugins/12/maven-plugins-12.pom
> [WARNING] Unable to get resource
> 'org.apache.maven.plugins:maven-plugins:pom:12' from repository  
> central
> (http://repo1.maven.org/maven2): Error transferring fil
> e: repo1.maven.org
> Downloading:
> file:///c:/repo/offline-repo-4//org/apache/maven/plugins/maven-
> plugins/12/maven-plugins-12.pom
> 11K downloaded  (maven-plugins-12.pom)
> Downloading:
> http://repo1.maven.org/maven2/org/apache/maven/maven-parent/9/maven-parent-9.pom
> [WARNING] Unable to get resource 'org.apache.maven:maven-parent:pom:
> 9' from
> repository central (http://repo1.maven.org/maven2): Error  
> transferring file:
> repo1.m
> aven.org
> Downloading:
> file:///c:/repo/offline-repo-4//org/apache/maven/maven-parent/9/
> maven-parent-9.pom
> 32K downloaded  (maven-parent-9.pom)
> Downloading: http://repo1.maven.org/maven2/org/apache/apache/4/apache-4.pom
> [WARNING] Unable to get resource 'org.apache:apache:pom:4' from  
> repository
> central (http://repo1.maven.org/maven2): Error transferring file:
> repo1.maven.org
> Downloading:
> file:///c:/repo/offline-repo-4//org/apache/apache/4/apache-4.pom
> 4K downloaded  (apache-4.pom)
> Downloading:
> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.3/maven-resources-plugin-2.3.jar
> [WARNING] Unable to get resource
> 'org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.3'  
> from
> repository central (http://repo1.maven.org/maven2): Err
> or transferring file: repo1.maven.org
> [INFO]
> ---
> ---------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO]
> ---
> ---------------------------------------------------------------------
> [INFO] A required plugin was not found: Plugin could not be found -  
> check
> that the goal name is correct: Unable to download the artifact from  
> any
> repository
>
> Try downloading the file manually from the project website.
>
> Then, install it using the command:
>    mvn install:install-file -DgroupId=org.apache.maven.plugins
> -DartifactId=maven-resources-plugin -Dversion=2.3 -Dpackaging=maven-
> plugin
> -Dfile=/path/to/file
>
> Alternatively, if you host your own repository you can deploy the file
> there:
>    mvn deploy:deploy-file -DgroupId=org.apache.maven.plugins
> -DartifactId=maven-resources-plugin -Dversion=2.3 -Dpackaging=maven-
> plugin
> -Dfile=/path/to/file -D
> url=[url] -DrepositoryId=[id]
>
>
>  org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.3
>
> from the specified remote repositories:
>  central (http://repo1.maven.org/maven2)
>
>
>  org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.3
>
> from the specified remote repositories:
>  central (http://repo1.maven.org/maven2)
>
> The latter creates to my "normal local repo" (C:\Documents and....)
> following:
>
> C:\Documents and
> Settings\username\.m2\repository\org\apache\maven\plugins\maven-
> resources-plugin\2.3>dir
> 19.03.2010  16:41             4 683 maven-resources-plugin-2.3.pom
> 19.03.2010  16:41                40 maven-resources-
> plugin-2.3.pom.sha1
>
> So it seems Maven is able to get the pom and it's sha1 from the  
> "offline
> repo" but for some reason does not fetch the jar from the same place.
>
> What's going on here....I would like to understand?
> --
> View this message in context: http://old.nabble.com/Creating-repository-for-offline-building-with-dependency%3Ago-offline-fails-tp27950979p27950979.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Wendy Smoak
In reply to this post by napple fabble
On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <[hidden email]> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Kathryn Huxtable
On Mar 19, 2010, at 10:13 AM, Wendy Smoak wrote:

> On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <[hidden email]> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

napple fabble
In reply to this post by napple fabble
Figured out the problem. In addition to the <repositories>, I need to define <pluginRepositories>, as well. Adding

      <pluginRepositories>
        <pluginRepository>
          <id>blaRepo</id>
          <url>file:///c:/repo/offline-repo-4</url>
          <layout>default</layout>
        </pluginRepository>
      </pluginRepositories>

Soveld the problem with the maven-resources-plugin.

Still the offline build fails, this time with:


D:\projects\zzzz2>mvn package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building safProto - AppFramework Application
[INFO]    task-segment: [package]
[INFO] ------------------------------------------------------------------------
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/plugins/maven-resources-plugin/2.3/maven-resources-plugin-2.3.pom
4K downloaded  (maven-resources-plugin-2.3.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/plugins/maven-plugins/12/maven-plugins-12.pom
11K downloaded  (maven-plugins-12.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/maven-parent/9/maven-parent-9.pom
32K downloaded  (maven-parent-9.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/apache/4/apache-4.pom
4K downloaded  (apache-4.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/plugins/maven-resources-plugin/2.3/maven-resources-plugin-2.3.jar
20K downloaded  (maven-resources-plugin-2.3.jar)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/plugins/maven-compiler-plugin/2.0.2/maven-compiler-plugin-2.0.2.pom
2K downloaded  (maven-compiler-plugin-2.0.2.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/plugins/maven-plugins/8/maven-plugins-8.pom
5K downloaded  (maven-plugins-8.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/maven-parent/5/maven-parent-5.pom
14K downloaded  (maven-parent-5.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/apache/3/apache-3.pom
3K downloaded  (apache-3.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/plugins/maven-compiler-plugin/2.0.2/maven-compiler-plugin-2.0.2.jar
17K downloaded  (maven-compiler-plugin-2.0.2.jar)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
[INFO] Unable to find resource 'org.apache.maven.plugins:maven-surefire-plugin:pom:2.4.3' in repository blaRepo (file:///c:/repo/offline-repo-4)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-surefire-plugin:pom:2.4.3' from repository central (http://repo1.maven.org/maven2): Error trans
ferring file: repo1.maven.org
Downloading: file:///c:/repo/offline-repo-4//org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
[INFO] Unable to find resource 'org.apache.maven.plugins:maven-surefire-plugin:pom:2.4.3' in repository offline-repository (file:///c:/repo/offline-repo-4/)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-surefire-plugin:pom:2.4.3' from repository central (http://repo1.maven.org/maven2): Error trans
ferring file: repo1.maven.org
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: org.apache.maven.plugins:maven-surefire-plugin

Reason: POM 'org.apache.maven.plugins:maven-surefire-plugin' not found in repository: Unable to download the artifact from any repository

  org.apache.maven.plugins:maven-surefire-plugin:pom:2.4.3

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  blaRepo (file:///c:/repo/offline-repo-4),
  offline-repository (file:///c:/repo/offline-repo-4/)

 for project org.apache.maven.plugins:maven-surefire-plugin


Sure enough, there's no maven-surefire-plugin in my offline repository. It seems this is caused by a bug in the dependency plugin: http://jira.codehaus.org/browse/MDEP-198?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel

blaghhghhhhhh...
Reply | Threaded
Open this post in threaded view
|

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

napple fabble
In reply to this post by napple fabble
Sorry if the posts are doubled, nabble's subscribing is playing tricks on me....

Figured out the problem. In addition to the <repositories>, I need to define <pluginRepositories>, as well. Adding

      <pluginRepositories>
        <pluginRepository>
          <id>blaRepo</id>
          <url>file:///c:/repo/offline-repo-4</url>
          <layout>default</layout>
        </pluginRepository>
      </pluginRepositories>

Soveld the problem with the maven-resources-plugin.

Still the offline build fails, this time with:


D:\projects\zzzz2>mvn package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building safProto - AppFramework Application
[INFO]    task-segment: [package]
[INFO] ------------------------------------------------------------------------
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/plugins/maven-resources-plugin/2.3/maven-resources-plugin-2.3.pom
4K downloaded  (maven-resources-plugin-2.3.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/plugins/maven-plugins/12/maven-plugins-12.pom
11K downloaded  (maven-plugins-12.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/maven-parent/9/maven-parent-9.pom
32K downloaded  (maven-parent-9.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/apache/4/apache-4.pom
4K downloaded  (apache-4.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/plugins/maven-resources-plugin/2.3/maven-resources-plugin-2.3.jar
20K downloaded  (maven-resources-plugin-2.3.jar)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/plugins/maven-compiler-plugin/2.0.2/maven-compiler-plugin-2.0.2.pom
2K downloaded  (maven-compiler-plugin-2.0.2.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/plugins/maven-plugins/8/maven-plugins-8.pom
5K downloaded  (maven-plugins-8.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/maven-parent/5/maven-parent-5.pom
14K downloaded  (maven-parent-5.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/apache/3/apache-3.pom
3K downloaded  (apache-3.pom)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/plugins/maven-compiler-plugin/2.0.2/maven-compiler-plugin-2.0.2.jar
17K downloaded  (maven-compiler-plugin-2.0.2.jar)
Downloading: file:///c:/repo/offline-repo-4/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
[INFO] Unable to find resource 'org.apache.maven.plugins:maven-surefire-plugin:pom:2.4.3' in repository blaRepo (file:///c:/repo/offline-repo-4)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-surefire-plugin:pom:2.4.3' from repository central (http://repo1.maven.org/maven2): Error trans
ferring file: repo1.maven.org
Downloading: file:///c:/repo/offline-repo-4//org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
[INFO] Unable to find resource 'org.apache.maven.plugins:maven-surefire-plugin:pom:2.4.3' in repository offline-repository (file:///c:/repo/offline-repo-4/)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-surefire-plugin:pom:2.4.3' from repository central (http://repo1.maven.org/maven2): Error trans
ferring file: repo1.maven.org
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: org.apache.maven.plugins:maven-surefire-plugin

Reason: POM 'org.apache.maven.plugins:maven-surefire-plugin' not found in repository: Unable to download the artifact from any repository

  org.apache.maven.plugins:maven-surefire-plugin:pom:2.4.3

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  blaRepo (file:///c:/repo/offline-repo-4),
  offline-repository (file:///c:/repo/offline-repo-4/)

 for project org.apache.maven.plugins:maven-surefire-plugin


Sure enough, there's no maven-surefire-plugin in my offline repository. It seems this is caused by a bug in the dependency plugin: http://jira.codehaus.org/browse/MDEP-198?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel

blaghhghhhhhh...
Reply | Threaded
Open this post in threaded view
|

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

napple fabble
In reply to this post by Wendy Smoak


Wendy Smoak wrote:

>
> On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <[hidden email]>
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>


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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

stephenconnolly
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 <[hidden email]> wrote:

>
>
> Wendy Smoak wrote:
> >
> > On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <[hidden email]>
> > 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: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
> >
>
>
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

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

napple fabble

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 <[hidden email]> wrote:
>
>>
>>
>> Wendy Smoak wrote:
>> >
>> > On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <[hidden email]>
>> > 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: [hidden email]
>> > For additional commands, e-mail: [hidden email]
>> >
>> >
>> >
>>
>>
>> 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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

stephenconnolly
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 <[hidden email]> 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 <[hidden email]> wrote:
> >
> >>
> >>
> >> Wendy Smoak wrote:
> >> >
> >> > On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <[hidden email]>
> >> > 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: [hidden email]
> >> > For additional commands, e-mail: [hidden email]
> >> >
> >> >
> >> >
> >>
> >>
> >> 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: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >
> >
>
> --
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

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

napple fabble
In reply to this post by napple fabble

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 <[hidden email]> wrote:
>>
>>>
>>>
>>> Wendy Smoak wrote:
>>> >
>>> > On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <[hidden email]>
>>> > 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: [hidden email]
>>> > For additional commands, e-mail: [hidden email]
>>> >
>>> >
>>> >
>>>
>>>
>>> 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: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>>
>
>

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

stephenconnolly
On 22 March 2010 09:15, napple fabble <[hidden email]> 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 <[hidden email]> wrote:
> >>
> >>>
> >>>
> >>> Wendy Smoak wrote:
> >>> >
> >>> > On Fri, Mar 19, 2010 at 10:54 AM, jimmi4664 <[hidden email]
> >
> >>> > 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: [hidden email]
> >>> > For additional commands, e-mail: [hidden email]
> >>> >
> >>> >
> >>> >
> >>>
> >>>
> >>> 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: [hidden email]
> >>> For additional commands, e-mail: [hidden email]
> >>>
> >>>
> >>
> >>
> >
> >
>
> --
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>