« Return to Thread: After installing Nexus maven is always tying to access localhost:8081 instead of www2.mydomain.com/nexus

After installing Nexus maven is always tying to access localhost:8081 instead of www2.mydomain.com/nexus

by Felipe Cypriano :: Rate this Message:

Reply to Author | View in Thread

Hello,

I'm trying to use Nexus as my company's internal repository, I've deployed nexus in glassfish and the url to access it is http://www2.mydomain.com/nexus/ so far so good.

Then, I configure the settings.xml to mirror everything to nexus plublic group:

<settings>
  <mirrors>
    <mirror>
      <id>litoral-repository</id>
      <name>Litoral Repository</name>
      <url>http://www2.mydomain.com/nexus/content/groups/public/</url>
      <mirrorOf>*</mirrorOf>
    </mirror>
  </mirrors>
  <profiles>
    <profile>
      <id>litoral</id>
      <!--Enable snapshots for the built in central repo to direct -->
      <!--all requests to nexus via the mirror -->
      <repositories>
        <repository>
          <id>central</id>
          <url>http://www2.mydomain.com/nexus/content/groups/public/</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://www2.mydomain.com/nexus/content/groups/public/</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
  <activeProfiles>
    <!--make the profile active all the time -->
    <activeProfile>litoral</activeProfile>
  </activeProfiles> 
</settings>

But when I execute any maven command I get an error because maven is trying to access http://localhost:8081/nexus/content/groups/public/, why this is happen? I haven't installed Nexus on localhost.

If I force maven to use a empty settings file (mvn <...> -s empty.xml) everything works.

How could I solve this?

---
Felipe Cypriano

 « Return to Thread: After installing Nexus maven is always tying to access localhost:8081 instead of www2.mydomain.com/nexus