Dev - Nexus
  1. Dev - Nexus
  2. NEXUS-1121

Nexus is not able to work with Amazon S3 Repositories, like SpringSource repository

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.1
    • Fix Version/s: 1.3, 1.4.0
    • Component/s: Repository
    • Labels:
      None
    • Global Rank:
      5856

      Description

      I've set up the proxy of 2 SpringSource repositories in our Nexus:
      http://repository.springsource.com/maven/bundles/release
      http://repository.springsource.com/maven/bundles/external

      However it seems that Nexus is not able to get anything from those repositories.
      I've also found this post, but with no response:
      http://nexus.sonatype.org/mailing-list-user-archives.html#nabble-td19203412

        Activity

        Hide
        Tamás Cservenák added a comment -

        I am closing this issue, since I stepped even back to Nexus 1.3.0 and S3 reposes were working perfectly.

        Pascal, I tried your example actually, here is the transcript, where I "simulated" what maven does:

        cstamas@Marvin tmp]$ wget http://localhost:8081/nexus/content/repositories/spring-osgified/org/springframework/osgi/log4j.osgi/maven-metadata.xml
        --2009-06-23 21:54:45--  http://localhost:8081/nexus/content/repositories/spring-osgified/org/springframework/osgi/log4j.osgi/maven-metadata.xml
        localhost feloldása... 127.0.0.1, ::1, fe80::1
        Csatlakozás a következőhöz: localhost[127.0.0.1]:8081... kapcsolódva.
        HTTP kérés elküldve, várom a választ... 200 OK
        Hossz: 330
        Mentés ide: „maven-metadata.xml"
        
        100%[=========================================================================================================================================================================================>] 330         --.-K/s  idő 0s      
        
        2009-06-23 21:54:50 (31,5 MB/s) - „maven-metadata.xml" mentve [330/330]
        
        [cstamas@Marvin tmp]$ cat maven-metadata.xml 
        <?xml version="1.0" encoding="UTF-8"?><metadata>
          <groupId>org.springframework.osgi</groupId>
          <artifactId>log4j.osgi</artifactId>
          <version>1.2.15-SNAPSHOT</version>
          <versioning>
            <versions>
              <version>1.2.15-SNAPSHOT</version>
            </versions>
            <lastUpdated>20080321183012</lastUpdated>
          </versioning>
        </metadata>[cstamas@Marvin tmp]$ wget http://localhost:8081/nexus/content/repositories/spring-osgified/org/springframework/osgi/log4j.osgi/1.2.15-SNAPSHOT/maven-metadata.xml
        --2009-06-23 21:55:17--  http://localhost:8081/nexus/content/repositories/spring-osgified/org/springframework/osgi/log4j.osgi/1.2.15-SNAPSHOT/maven-metadata.xml
        localhost feloldása... 127.0.0.1, ::1, fe80::1
        Csatlakozás a következőhöz: localhost[127.0.0.1]:8081... kapcsolódva.
        HTTP kérés elküldve, várom a választ... 200 OK
        Hossz: 370
        Mentés ide: „maven-metadata.xml.1"
        
        100%[=========================================================================================================================================================================================>] 370         --.-K/s  idő 0s      
        
        2009-06-23 21:55:22 (27,1 MB/s) - „maven-metadata.xml.1" mentve [370/370]
        
        [cstamas@Marvin tmp]$ cat maven-metadata.xml.1
        <?xml version="1.0" encoding="UTF-8"?><metadata>
          <groupId>org.springframework.osgi</groupId>
          <artifactId>log4j.osgi</artifactId>
          <version>1.2.15-SNAPSHOT</version>
          <versioning>
            <snapshot>
              <timestamp>20080321.182649</timestamp>
              <buildNumber>20</buildNumber>
            </snapshot>
            <lastUpdated>20080321183012</lastUpdated>
          </versioning>
        

        As you see, Nexus served just fine stuff from proxy repository using remote URL of http://s3.amazonaws.com/maven.springframework.org/osgi

        But one important caveat: as far as i see, the repository you pointed out is mixed, it contains releases and snapshots, which is considered bad practice. Pascal, please be sure you set the repository policy to SNAPSHOT if you need snapshots from here, or one circumvention:

        Create two repositories to the same URL (http://s3.amazonaws.com/maven.springframework.org/osgi) like this:

        • spring-osgified-releases, with Repository policy RELEASES
        • spring-osgified-snapshots with Repository policy SNAPSHOTS

        and put them into a group, and access the using group URL. This will do it. Myself had a moment, when I puzzled, and realized that the proxy repo was set to release policy (the default), but you showed a dependency to snapshot artifact.

        With setup above, you will "fix" what spring people broke Nexus will separate the artifacts for releases and snapshots, but if using a group, you will not "see" anything of it. Good luck!

        Show
        Tamás Cservenák added a comment - I am closing this issue, since I stepped even back to Nexus 1.3.0 and S3 reposes were working perfectly. Pascal, I tried your example actually, here is the transcript, where I "simulated" what maven does: cstamas@Marvin tmp]$ wget http://localhost:8081/nexus/content/repositories/spring-osgified/org/springframework/osgi/log4j.osgi/maven-metadata.xml --2009-06-23 21:54:45-- http://localhost:8081/nexus/content/repositories/spring-osgified/org/springframework/osgi/log4j.osgi/maven-metadata.xml localhost feloldása... 127.0.0.1, ::1, fe80::1 Csatlakozás a következőhöz: localhost[127.0.0.1]:8081... kapcsolódva. HTTP kérés elküldve, várom a választ... 200 OK Hossz: 330 Mentés ide: „maven-metadata.xml" 100%[=========================================================================================================================================================================================>] 330 --.-K/s idő 0s 2009-06-23 21:54:50 (31,5 MB/s) - „maven-metadata.xml" mentve [330/330] [cstamas@Marvin tmp]$ cat maven-metadata.xml <?xml version="1.0" encoding="UTF-8"?><metadata> <groupId>org.springframework.osgi</groupId> <artifactId>log4j.osgi</artifactId> <version>1.2.15-SNAPSHOT</version> <versioning> <versions> <version>1.2.15-SNAPSHOT</version> </versions> <lastUpdated>20080321183012</lastUpdated> </versioning> </metadata>[cstamas@Marvin tmp]$ wget http://localhost:8081/nexus/content/repositories/spring-osgified/org/springframework/osgi/log4j.osgi/1.2.15-SNAPSHOT/maven-metadata.xml --2009-06-23 21:55:17-- http://localhost:8081/nexus/content/repositories/spring-osgified/org/springframework/osgi/log4j.osgi/1.2.15-SNAPSHOT/maven-metadata.xml localhost feloldása... 127.0.0.1, ::1, fe80::1 Csatlakozás a következőhöz: localhost[127.0.0.1]:8081... kapcsolódva. HTTP kérés elküldve, várom a választ... 200 OK Hossz: 370 Mentés ide: „maven-metadata.xml.1" 100%[=========================================================================================================================================================================================>] 370 --.-K/s idő 0s 2009-06-23 21:55:22 (27,1 MB/s) - „maven-metadata.xml.1" mentve [370/370] [cstamas@Marvin tmp]$ cat maven-metadata.xml.1 <?xml version="1.0" encoding="UTF-8"?><metadata> <groupId>org.springframework.osgi</groupId> <artifactId>log4j.osgi</artifactId> <version>1.2.15-SNAPSHOT</version> <versioning> <snapshot> <timestamp>20080321.182649</timestamp> <buildNumber>20</buildNumber> </snapshot> <lastUpdated>20080321183012</lastUpdated> </versioning> As you see, Nexus served just fine stuff from proxy repository using remote URL of http://s3.amazonaws.com/maven.springframework.org/osgi But one important caveat : as far as i see, the repository you pointed out is mixed , it contains releases and snapshots, which is considered bad practice . Pascal, please be sure you set the repository policy to SNAPSHOT if you need snapshots from here, or one circumvention: Create two repositories to the same URL ( http://s3.amazonaws.com/maven.springframework.org/osgi ) like this: spring-osgified-releases, with Repository policy RELEASES spring-osgified-snapshots with Repository policy SNAPSHOTS and put them into a group, and access the using group URL. This will do it. Myself had a moment, when I puzzled, and realized that the proxy repo was set to release policy (the default), but you showed a dependency to snapshot artifact. With setup above, you will "fix" what spring people broke Nexus will separate the artifacts for releases and snapshots, but if using a group, you will not "see" anything of it. Good luck!
        Hide
        Mauro Molinari added a comment -

        We're using Nexus Open Source Edition 2.0.4-1.
        We have this exact same problem: after adding http://repository.springsource.com/maven/bundles/release/ as a proxy repository (repository policy: release): the Browse Remote tab shows the contents of that repository correctly, BUT the Browse Index and Browse Storage tabs are empty (the latter one actually just shows archetype-catalog.xml).
        If I try to browse the repository through the Nexus webapp (http://nexushostname:8080/nexus/content/repositories/repositoryid), all that I see is archetype-catalog.xml.

        I can't make it work, so it seems to me that this issue is not fixed, at least in some circumstances. The system on which Tomcat+Nexus are installed is using a proxy to access the Internet: could it be this the cause of the problem?
        By the way, no problems with proxying Maven Central,

        Show
        Mauro Molinari added a comment - We're using Nexus Open Source Edition 2.0.4-1. We have this exact same problem: after adding http://repository.springsource.com/maven/bundles/release/ as a proxy repository (repository policy: release): the Browse Remote tab shows the contents of that repository correctly, BUT the Browse Index and Browse Storage tabs are empty (the latter one actually just shows archetype-catalog.xml). If I try to browse the repository through the Nexus webapp ( http://nexushostname:8080/nexus/content/repositories/repositoryid ), all that I see is archetype-catalog.xml. I can't make it work, so it seems to me that this issue is not fixed, at least in some circumstances. The system on which Tomcat+Nexus are installed is using a proxy to access the Internet: could it be this the cause of the problem? By the way, no problems with proxying Maven Central,
        Hide
        Tamás Cservenák added a comment -

        Mauro, you created a proxy repository that is initially empty, it will get populated gradually as you ask artifacts from it and it proxies them for you.

        Those repositories are not publishing index either, hence the Browse Index is empty too.

        Initiate a build that will involve your newly created proxy repository, and get back to it again, and check.

        Show
        Tamás Cservenák added a comment - Mauro, you created a proxy repository that is initially empty , it will get populated gradually as you ask artifacts from it and it proxies them for you. Those repositories are not publishing index either, hence the Browse Index is empty too. Initiate a build that will involve your newly created proxy repository, and get back to it again, and check.
        Hide
        Mauro Molinari added a comment -

        After many tests I was able to understand how things should work. The problem is I didn't understand that I must ask for a full-path to a POM in order to make Nexus populate something for a proxy repository. For instance, if my POM is at:
        http://nexushost:8081/nexus/content/repositories/repositoryid/org/springframework/org.springframework.context/3.1.1.RELEASE/org.springframework.context-3.1.1.RELEASE.pom
        and the proxy repository is empty and you ask for:
        http://nexushost:8081/nexus/content/repositories/repositoryid/org/springframework/org.springframework.context/3.1.1.RELEASE
        (or some other partial path), you get a 404. This led me to think things were not working.
        The use of Gradle didn't help either, because Gradle cached the missing artifact state and didn't work until we issued a --refresh-dependencies on it, so that it could retry to download the artifacts.

        So, sorry for the misunderstanding.

        Show
        Mauro Molinari added a comment - After many tests I was able to understand how things should work. The problem is I didn't understand that I must ask for a full-path to a POM in order to make Nexus populate something for a proxy repository. For instance, if my POM is at: http://nexushost:8081/nexus/content/repositories/repositoryid/org/springframework/org.springframework.context/3.1.1.RELEASE/org.springframework.context-3.1.1.RELEASE.pom and the proxy repository is empty and you ask for: http://nexushost:8081/nexus/content/repositories/repositoryid/org/springframework/org.springframework.context/3.1.1.RELEASE (or some other partial path), you get a 404. This led me to think things were not working. The use of Gradle didn't help either, because Gradle cached the missing artifact state and didn't work until we issued a --refresh-dependencies on it, so that it could retry to download the artifacts. So, sorry for the misunderstanding.
        Hide
        Eric Haszlakiewicz added a comment -

        One hint that might help people get this working, use "mvn -U ..." to get it to actually query Nexus again. Maven can cache the fact that it couldn't find an artifact, so even if you get Nexus setup properly mvn might still emit an error until that expires.

        Show
        Eric Haszlakiewicz added a comment - One hint that might help people get this working, use "mvn -U ..." to get it to actually query Nexus again. Maven can cache the fact that it couldn't find an artifact, so even if you get Nexus setup properly mvn might still emit an error until that expires.

          People

          • Assignee:
            Tamás Cservenák
            Reporter:
            Deleted User
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Date of First Response: