You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kenneth Petersen <kp...@lpk.dk> on 2010/05/17 11:56:30 UTC

Using Maven without internet access

I am new to Maven, so if the answer is simple, I apologies.

I am trying to use Maven on a network with firewall restrictions disallowing Maven access to the different remote internet repositories. Therefore I need to install a Maven remote repository within the network, and have all Maven plug-in retrieved from this server.

For testing purposes, I have installed a Tomcat server on localhost, and added the artifactory.war file.

After installion artifactory, I have downloaded the following plug-in
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.3/maven-resources-plugin-2.3.jar
and deployed it in Artifactory.

In order to get Maven to use the "remote repository" running in Tomcat, I have added the following snippet to my pom.xml
<repositories>
  <repository>
    <releases>
      <enabled>false</enabled>
      <updatePolicy>always</updatePolicy>
      <checksumPolicy>warn</checksumPolicy>
    </releases>
    <snapshots>
      <enabled>true</enabled>
      <updatePolicy>never</updatePolicy>
      <checksumPolicy>fail</checksumPolicy>
    </snapshots>
    <id>LPK</id>
    <name>LPK Repository</name>
    <url>http://localhost:8080/artifactory</url>
    <layout>default</layout>
  </repository>
</repositories>

I expected this to tell Maven not to use the standard remote repositories, but use my local version.

When I now execute "mvn package", I get the following message:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building FutoramaUtil
[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 transferring file: Connection timed out: connect
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 transferring file: Connection timed out: connect
[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: Unable to download the artifact from any repository

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

from the specified remote repositories:
 central (http://repo1.maven.org/maven2),
 LPK (http://localhost:8080/artifactory)

for project org.apache.maven.plugins:maven-resources-plugin
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 43 seconds
[INFO] Finished at: Mon May 17 11:35:46 CEST 2010
[INFO] Final Memory: 1M/15M

>From this I conclude that I did not succeed in telling Maven to use my central repository. Where do I tell Maven to only use the localhost repository?



Best regards

Kenneth Petersen

Re: Using Maven without internet access

Posted by Anders Hammar <an...@hammar.net>.
Not sure if you intended to write some reply? Your mail was blank.

/Anders

On Mon, May 17, 2010 at 11:56, Kenneth Petersen <kp...@lpk.dk> wrote:

>  I am new to Maven, so if the answer is simple, I apologies.
>
> I am trying to use Maven on a network with firewall restrictions
> disallowing Maven access to the different remote internet repositories.
> Therefore I need to install a Maven remote repository within the network,
> and have all Maven plug-in retrieved from this server.
>
> For testing purposes, I have installed a Tomcat server on localhost, and
> added the artifactory.war file.
>
> After installion artifactory, I have downloaded the following plug-in
>
> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.3/maven-resources-plugin-2.3.jar
> and deployed it in Artifactory.
>
> In order to get Maven to use the "remote repository" running in Tomcat, I
> have added the following snippet to my pom.xml
> <repositories>
>  <repository>
>    <releases>
>      <enabled>false</enabled>
>      <updatePolicy>always</updatePolicy>
>      <checksumPolicy>warn</checksumPolicy>
>    </releases>
>    <snapshots>
>      <enabled>true</enabled>
>      <updatePolicy>never</updatePolicy>
>      <checksumPolicy>fail</checksumPolicy>
>    </snapshots>
>    <id>LPK</id>
>    <name>LPK Repository</name>
>    <url>http://localhost:8080/artifactory</url>
>    <layout>default</layout>
>  </repository>
> </repositories>
>
> I expected this to tell Maven not to use the standard remote repositories,
> but use my local version.
>
> When I now execute "mvn package", I get the following message:
>
> [INFO] Scanning for projects...
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building FutoramaUtil
> [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 transferring file:
> Connection timed out: connect
> 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 transferring file:
> Connection timed out: connect
> [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: Unable to download the artifact from any repository
>
> org.apache.maven.plugins:maven-resources-plugin:pom:2.3
>
> from the specified remote repositories:
>  central (http://repo1.maven.org/maven2),
>  LPK (http://localhost:8080/artifactory)
>
> for project org.apache.maven.plugins:maven-resources-plugin
> [INFO]
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 43 seconds
> [INFO] Finished at: Mon May 17 11:35:46 CEST 2010
> [INFO] Final Memory: 1M/15M
>
> From this I conclude that I did not succeed in telling Maven to use my
> central repository. Where do I tell Maven to only use the localhost
> repository?
>
>
>
> Best regards
>
> Kenneth Petersen
>