Maven cannot find dependencies from remote nexus repository

I had to migrate from a older Nexus server to Nexus OSS v2.0.4 today. I have been facing strange issues from the morning. Firstly I installed nexus and started it, and I was able to browse it from the server machine only once and then no more. But later from all other machines in the network I could access the server (using http://remote.hostname:8081/nexus ).

Then I copied all the contents of the storage directory from the old server machine and pasted them one by one into the new machine. (For every repository, created a repository in the new server and gave the local storage Location as the directory which i copied from the old server). Now I am able to see all the jars which I had, but when I try to use them from maven, I am not able to do so. Meaning, if i try to run a maven project, then it says dependencies not found. I can see that it is looking for jar exactly in the place where it lies in the new server, but fails to download it. Any idea why it is not able to download the jars?

Also I am still not able to access the new nexus server from the server machine's browser, why is it so? Any suggestions will be appreciated. Thanks.

====UPDATE====

When I fiddled around with maven, I found that I am able to access the dependencies from public repository, but not from one specific repository (only one so far I am aware of). Can this be because of some reason? I suspect some wrong matter of migration, is it the proper way of migrating from one server to another?

Also, all the proxy repositories are having the status as In service-Remote automatically blocked and unavailable. Is this related to my problem somehow?

===Settings.xml===

<settings>

  <localRepository>${env.TEST_HOME}\maven.repository</localRepository>

<proxies>
<proxy>
  <id>Compproxy</id>
  <active>true</active>
  <protocol>http</protocol>
  <username></username>
  <password></password>
  <host>proxy.abc.com</host>
  <port>81</port>
  <nonProxyHosts>*.abc.com|rick*</nonProxyHosts>
</proxy>
</proxies>
    <servers>
<server>
    <id>MyRep</id>
  <username>admin</username>
  <password>admin123</password>
</server>
</servers>
<mirrors>
<mirror>
  <id>central mirror</id>
  <url>http://rick1.abc.com:8081/nexus/content/groups/public</url>
  <mirrorOf>central</mirrorOf>
 </mirror>
 <mirror>
  <id>opensymphony mirror</id>
  <url>http://rick1.abc.com:8081/nexus/content/groups/public</url>
  <mirrorOf>opensymphony</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
  <id>actProf</id>
  <repositories>
    <repository>
        <id>public</id>
        <url>http://rick1:8081/nexus/content/groups/public</url>
    </repository>
    <repository>
        <id>MyRep</id>
        <url>http://rick1:8081/nexus/content/repositories/MyRep</url>
    </repository>
  </repositories>
  <properties>
  </properties>        
</profile>
</profiles>
<activeProfiles>
<activeProfile>actProf</activeProfile>
</activeProfiles>
</settings>

===pom.xml===

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.abc.test</groupId>
  <artifactId>testgui_start</artifactId>
  <packaging>pom</packaging>
  <version>1</version>
  <name>Start POM Test GUI</name>
  <url>www.abc.com</url>
  <build>
<plugins>
</plugins>
</build>
  <dependencies>
  <dependency>
    <groupId>com.abc.test</groupId>
    <artifactId>testgui</artifactId>
    <version>${version}</version>
    <scope>runtime</scope>
  </dependency>
</dependencies>
</project>

Answers


One thing you will have to do is add all the repositories you create to the public group so they become available to Maven, provided you are using the standard settings.xml that just references the public group.

Further more I would stop and restart the server and have a close look at the log and report back with more info. It might be set up to listen on specific ports and such. Also keep in mind that the startup scripts changed when we moved to 2.0 so you will have to replace the old ones that you put e.g. in /etc/init.d/.


Need Your Help

Java memory mapped files and swap

java linux memory-management

I'm looking at some memory mapped files in Java. Let's say I have a heap size set to 2gb, and I memory map a file that is 50gb - far more than the physical memory on the machine. The OS will cache ...