Why are alternate repositories so hard to configure

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

Why are alternate repositories so hard to configure

Eric Kolotyluk
I have the following

<repositories>
<repository>
<id>sonatype</id>
<name>Sonatype Maven OSS Repository</name>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>https://oss.sonatype.org/content/groups/public</url>
</repository>
</repositories>

But when I run maven I get

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on
project csharp-windows-elevate: Execution default-site of goal
org.apache.maven.plugins:maven-site-plugin:3.3:site failed: Plugin
org.apache.maven.plugins:maven-site-plugin:3.3 or one of its
dependencies could not be resolved: Could not find artifact
net.trajano.wagon:wagon-git:jar:1.0.1-SNAPSHOT in apache.snapshots
(http://repository.apache.org/snapshots) -> [Help 1]

/*Why in the world is it looking in
http://repository.apache.org/snapshots ???*/

So, then I configure nexus to mirror
https://oss.sonatype.org/content/groups/public and I add to my settings.xml

   <mirrors>
     <mirror>
       <id>nexus</id>
       <mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public</url>
     </mirror>
   </mirrors>

and then I get

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on
project csharp-windows-elevate: Execution default-site of goal
org.apache.maven.plugins:maven-site-plugin:3.3:site failed: Plugin
org.apache.maven.plugins:maven-site-plugin:3.3 or one of its
dependencies could not be resolved: Could not find artifact
net.trajano.wagon:wagon-git:jar:1.0.1-SNAPSHOT in nexus
(http://localhost:8081/nexus/content/groups/public) -> [Help 1]

I know this to be a lie because when I go through the nexus UI I can
clearly see the artifact in question in both the nexus index and
storage. However, for some reason, the artifact pom.xml is neither in
the index nor storage. When I go to
https://oss.sonatype.org/content/groups/public/net/trajano/wagon/wagon-git/1.0.1-SNAPSHOT/ 
I can clearly see the pom.xml with the other files that nexus has
downloaded. /*Why is nexus refusing to download the pom.xml?*//*
*/
Cheers, Eric



Reply | Threaded
Open this post in threaded view
|

RE: [nexus-user] Why are alternate repositories so hard to configure

Frank Mueller
Do you have anonymous access enabled in you Nexus instance?

You did not have any credentials in your (I assume) settings.xml.

The problem with the apache.org repo might be caused by missing the Pluginrepo configuration. Maybe try something like the following:

-------------------------[snip]------------------------
  <profiles>
    <profile>
      <id>nexus</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
  <mirrors>
    <mirror>
      <id>nexus</id>
      <mirrorOf>central</mirrorOf>
      <url>https://your.nexus.url/content/groups/public</url>
    </mirror>
  </mirrors>
-------------------------[snap]------------------------

Regarding the download problems, do you have added the repository to the public group?`

Best regards

Frank


From: Eric Kolotyluk [mailto:[hidden email]]
Sent: Tuesday, April 15, 2014 5:15 AM
To: maven users; [hidden email]
Subject: [nexus-user] Why are alternate repositories so hard to configure

I have the following

      <repositories>
        <repository>
            <id>sonatype</id>
            <name>Sonatype Maven OSS Repository</name>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <url>https://oss.sonatype.org/content/groups/public</url>
        </repository>
      </repositories>

But when I run maven I get

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project csharp-windows-elevate: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.3:site failed: Plugin org.apache.maven.plugins:maven-site-plugin:3.3 or one of its dependencies could not be resolved: Could not find artifact net.trajano.wagon:wagon-git:jar:1.0.1-SNAPSHOT in apache.snapshots (http://repository.apache.org/snapshots) -> [Help 1]

Why in the world is it looking in http://repository.apache.org/snapshots ???

So, then I configure nexus to mirror https://oss.sonatype.org/content/groups/public and I add to my settings.xml

  <mirrors>
    <mirror>
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://localhost:8081/nexus/content/groups/public</url>
    </mirror>
  </mirrors>

and then I get

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project csharp-windows-elevate: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.3:site failed: Plugin org.apache.maven.plugins:maven-site-plugin:3.3 or one of its dependencies could not be resolved: Could not find artifact net.trajano.wagon:wagon-git:jar:1.0.1-SNAPSHOT in nexus (http://localhost:8081/nexus/content/groups/public) -> [Help 1]

I know this to be a lie because when I go through the nexus UI I can clearly see the artifact in question in both the nexus index and storage. However, for some reason, the artifact pom.xml is neither in the index nor storage. When I go to https://oss.sonatype.org/content/groups/public/net/trajano/wagon/wagon-git/1.0.1-SNAPSHOT/ I can clearly see the pom.xml with the other files that nexus has downloaded. Why is nexus refusing to download the pom.xml?

Cheers, Eric


Reply | Threaded
Open this post in threaded view
|

Re: [nexus-user] Why are alternate repositories so hard to configure

Peter Lynch-2
In reply to this post by Eric Kolotyluk
Hello,

On Tue, Apr 15, 2014 at 12:14 AM, Eric Kolotyluk
<[hidden email]>wrote:

>  I have the following
>
>       <repositories>
>         <repository>
>             <id>sonatype</id>
>             <name>Sonatype Maven OSS Repository</name>
>             <releases>
>                 <enabled>true</enabled>
>             </releases>
>             <snapshots>
>                 <enabled>true</enabled>
>             </snapshots>
>             <url>https://oss.sonatype.org/content/groups/public</url>
>         </repository>
>       </repositories>
>
> But when I run maven I get
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on
> project csharp-windows-elevate: Execution default-site of goal
> org.apache.maven.plugins:maven-site-plugin:3.3:site failed: Plugin
> org.apache.maven.plugins:maven-site-plugin:3.3 or one of its dependencies
> could not be resolved: Could not find artifact
> net.trajano.wagon:wagon-git:jar:1.0.1-SNAPSHOT in apache.snapshots (
> http://repository.apache.org/snapshots) -> [Help 1]
>
> *Why in the world is it looking in http://repository.apache.org/snapshots
> <http://repository.apache.org/snapshots> ???*
>

This repository is defined in a pom.xml of a dependency.


>
>
> So, then I configure nexus to mirror
> https://oss.sonatype.org/content/groups/public and I add to my
> settings.xml
>
>   <mirrors>
>     <mirror>
>       <id>nexus</id>
>       <mirrorOf>*</mirrorOf>
>       <url>http://localhost:8081/nexus/content/groups/public</url>
>     </mirror>
>   </mirrors>
>
>
Good idea.


> and then I get
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on
> project csharp-windows-elevate: Execution default-site of goal
> org.apache.maven.plugins:maven-site-plugin:3.3:site failed: Plugin
> org.apache.maven.plugins:maven-site-plugin:3.3 or one of its dependencies
> could not be resolved: Could not find artifact
> net.trajano.wagon:wagon-git:jar:1.0.1-SNAPSHOT in nexus (
> http://localhost:8081/nexus/content/groups/public) -> [Help 1]
>

apache-snapshots is not in the public group by default, although it is in
Nexus as a repository. You can edit the public group members and add
apache-snapshots as a member.




>
> I know this to be a lie because when I go through the nexus UI I can
> clearly see the artifact in question in both the nexus index and storage.
> However, for some reason, the artifact pom.xml is neither in the index nor
> storage. When I go to
> https://oss.sonatype.org/content/groups/public/net/trajano/wagon/wagon-git/1.0.1-SNAPSHOT/I can clearly see the pom.xml with the other files that nexus has
> downloaded. *Why is nexus refusing to download the pom.xml?*
>

Search indexes have nothing to do with an artifact being able to be
downloaded.

In cases like this, these article may help you diagnose:

https://support.sonatype.com/entries/21437881-Troubleshooting-Artifact-Download-Failures


>
>
> Cheers, Eric
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [nexus-user] Why are alternate repositories so hard to configure

Eric Kolotyluk
In reply to this post by Frank Mueller
Thanks Frank, I added what you suggested to my settings.xml, but the
problem turned out to be that I forgot to add sonatype-oss to the public
group.

I have been caught by that problem in the past, as I recall, and a
better UI would ask you if you wanted to add a newly created remote repo
to public when you created it.

Cheers, Eric

On 4/15/2014 2:19 AM, Frank Mueller wrote:

Do you have anonymous access enabled in you Nexus instance?

You did not have any credentials in your (I assume) settings.xml.

The problem with the apache.org repo might be caused by missing the
Pluginrepo configuration. Maybe try something like the following:

-------------------------[snip]------------------------

<profiles>

<profile>

<id>nexus</id>

<activation>

<activeByDefault>true</activeByDefault>

</activation>

<repositories>

<repository>

<id>central</id>

<url>http://central</url>

<releases><enabled>true</enabled></releases>

<snapshots><enabled>true</enabled></snapshots>

</repository>

</repositories>

<pluginRepositories>

<pluginRepository>

<id>central</id>

<url>http://central</url>

<releases><enabled>true</enabled></releases>

<snapshots><enabled>true</enabled></snapshots>

</pluginRepository>

</pluginRepositories>

</profile>

</profiles>

<mirrors>

<mirror>

<id>nexus</id>

<mirrorOf>central</mirrorOf>

<url>https://your.nexus.url/content/groups/public</url>

</mirror>

</mirrors>

-------------------------[snap]------------------------

Regarding the download problems, do you have added the repository to the
public group?`

Best regards


Frank

>
> <mirrors>
>
> <mirror>
>
> <id>nexus</id>
>
> <mirrorOf>central</mirrorOf>
>
> <url>https://your.nexus.url/content/groups/public</url>
>
> </mirror>
>
> </mirrors>
>

Reply | Threaded
Open this post in threaded view
|

Re: [nexus-user] Why are alternate repositories so hard to configure

Eric Kolotyluk
In reply to this post by Peter Lynch-2
Hello back :-)

On 4/15/2014 6:50 AM, Peter Lynch wrote:

> Hello,
>
> On Tue, Apr 15, 2014 at 12:14 AM, Eric Kolotyluk
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     I have the following
>
>     <repositories>
>     <repository>
>     <id>sonatype</id>
>     <name>Sonatype Maven OSS Repository</name>
>     <releases>
>     <enabled>true</enabled>
>     </releases>
>     <snapshots>
>     <enabled>true</enabled>
>     </snapshots>
>     <url>https://oss.sonatype.org/content/groups/public</url>
>     </repository>
>     </repositories>
>
>     But when I run maven I get
>
>     [ERROR] Failed to execute goal
>     org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site)
>     on project csharp-windows-elevate: Execution default-site of goal
>     org.apache.maven.plugins:maven-site-plugin:3.3:site failed: Plugin
>     org.apache.maven.plugins:maven-site-plugin:3.3 or one of its
>     dependencies could not be resolved: Could not find artifact
>     net.trajano.wagon:wagon-git:jar:1.0.1-SNAPSHOT in apache.snapshots
>     (http://repository.apache.org/snapshots) -> [Help 1]
>
>     /*Why in the world is it looking in
>     http://repository.apache.org/snapshots ???*/
>
>
> This repository is defined in a pom.xml of a dependency.

Yes, the maven-site-plugin was referencing apache/snapshots in its
<dependencyManagement> section. Yet another tangle with 'dependency hell'

>
>
>     So, then I configure nexus to mirror
>     https://oss.sonatype.org/content/groups/public and I add to my
>     settings.xml
>
>       <mirrors>
>         <mirror>
>           <id>nexus</id>
>           <mirrorOf>*</mirrorOf>
>           <url>http://localhost:8081/nexus/content/groups/public</url>
>         </mirror>
>       </mirrors>
>
>
> Good idea.
>
>     and then I get
>
>     [ERROR] Failed to execute goal
>     org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site)
>     on project csharp-windows-elevate: Execution default-site of goal
>     org.apache.maven.plugins:maven-site-plugin:3.3:site failed: Plugin
>     org.apache.maven.plugins:maven-site-plugin:3.3 or one of its
>     dependencies could not be resolved: Could not find artifact
>     net.trajano.wagon:wagon-git:jar:1.0.1-SNAPSHOT in nexus
>     (http://localhost:8081/nexus/content/groups/public) -> [Help 1]
>
>
> apache-snapshots is not in the public group by default, although it is
> in Nexus as a repository. You can edit the public group members and
> add apache-snapshots as a member.
>

Taking apache-snapshots offline in my Nexus configuration was one of the
first things I did, but the problem was stemming from maven-site-plugin.

>
>
>     I know this to be a lie because when I go through the nexus UI I
>     can clearly see the artifact in question in both the nexus index
>     and storage. However, for some reason, the artifact pom.xml is
>     neither in the index nor storage. When I go to
>     https://oss.sonatype.org/content/groups/public/net/trajano/wagon/wagon-git/1.0.1-SNAPSHOT/
>     I can clearly see the pom.xml with the other files that nexus has
>     downloaded. /*Why is nexus refusing to download the pom.xml?*/
>
>
> Search indexes have nothing to do with an artifact being able to be
> downloaded.
>
> In cases like this, these article may help you diagnose:
>
> https://support.sonatype.com/entries/21437881-Troubleshooting-Artifact-Download-Failures

In my case, I forgot to add sonatype-oss to the public group in Nexus. A
better Nexus GUI would ask the user if they wanted to add a newly
created remote repo to the public group. I have been caught by this
problem more than once, and the diagnostics around the problem are not
very good.

>     /*
>     */
>     Cheers, Eric
>
>
>
>