Maven Artifacts

Ben Hale

Up to this point the Spring Portfolio Maven artifacts, especially the snapshots, were inconsitently created and scattered about in various locations. Over the past couple of weeks, we've been working to get the projects to be more consistent in the creation and uploading of these artifacts.

Maven Repositories

One of the most useful improvements to the Maven support in the Spring Portfolio is the use of consistent repository locations. There are three different repositories depending on your level of comfort with the code.

Release Repository

For any final release (Spring 2.5, Spring Web Flow 2.0, etc.) the Maven artifacts for that release will be uploaded to the Maven Central repository (http://repo1.maven.org/maven2). Using this repository requires no effort on your part as Maven will automatically look for artifacts there.

The artifacts in this repository do follow expected repository behaviors and will not (and cannot) not be removed.

Milestone Repository

For any milestone release (Spring 2.5-RC1, Spring Web Flow 2.0-M2, etc.) the Maven artifacts for that release will be uploaded to the the Spring Milestone repository (http://s3.amazonaws.com/maven.springframework.org/milestone). Using this repository requires you to add an entry to the <repositories/> element in your POM. It should look like this:

<repository>
    <id>spring-milestone</id>
    <name>Spring Portfolio Milestone Repository</name>
    <url>http://s3.amazonaws.com/maven.springframework.org/milestone</url>
</repository>

The artifacts in this repository do not follow expected repository behaviors and will be removed regularly. Upon the release of a final version (Spring 2.6, Spring Web Flow 2.1, etc.) all milestone versions from the previous release of an artifact will be removed. For example, when Spring 2.6 is released, Spring 2.5 milestones will be removed while Spring 2.6 milestones will be retained.

Snapshot Repository

For any snapshot build (Spring 2.5-SNAPSHOT, Spring Web Flow 2.0-SNAPSHOT, etc.) the Maven artifacts for that build will be uploaded to the Spring Snapshot repository (http://s3.amazonaws.com/maven.springframework.org/snapshot). Using this repository requires you to add an entry to the <repositories/> element in your POM. It should look like this:

<repository>
    <id>spring-snapshot</id>
    <name>Spring Portfolio Snapshot Repository</name>
    <url>http://s3.amazonaws.com/maven.springframework.org/snapshot</url>
</repository>

The artifacts in this repository do not follow expected repository behaviors and will be removed regularly. At least the last 10 snapshot builds for a given artifact will be retained. If an artifact is removed from a distribution its snapshot builds will be removed immediately. On the release of a milestone or a final release, all snapshots for an artifact will be removed and a new snapshot for the next release created.

Repository Browsing

The milestone and snapshot repositories are both hosted on Amazon's S3 service and as such the directory structure is not human-readable. To view the repositories in a human-readable format, use the S3Browse utility.

Only use these URLs for human-readable viewing. If you use them as the URLs for your POMs you will encounter errors.

Artifact Sources

Another important improvement is the addition of source artifacts for all releases. You will notice in the milestone repository all artifacts have sources deployed with them. This will also be true as we go forward for all final releases as well. Specifically, starting with the Spring 2.5 release, in addition to the combined Spring sources, each module will also have a source artifact.

Spring Snapshots

The final improvement is one that isn't yet complete; a nightly snapshot of Spring. I'm pleased to say that this is close to being completed. I'm still working out the final kinks with respect to the Maven Ant Tasks but this will eventually start showing up and I'll announce it again when it does. As well, you can expect this functionality to eventually make its way out to all of the other ANT-based Spring Portfolio projects so that all projects will create Maven snapshots as well as milestones.

Similar Posts

Share this Post
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • DZone
  • LinkedIn
  • Slashdot
  • Technorati
  • TwitThis
 

23 responses


  1. nice! ;)


  2. yoho! thanks a lot (especially for the source attachments) - maven rocks! :-)


  3. The source attachments is a biggie for me too..

    Thanks a lot and keep it up!!!


  4. Good stuff, thanks!


  5. This is fantastic news. I'd been feeling the need for non-final releases lately and now I can integrate seamlessly using maven without setting up my own repositories. Thanks! Out of curiosity what the driving motivation to use aws as opposed to normal hosting?


  6. [quote post="221"]Out of curiosity what the driving motivation to use aws as opposed to normal hosting?[/quote]

    Cost mostly. If you take a look at the S3 service it's at $0.18/GB for bandwidth and $0.15/GB-month for storage. So for what ends up being very low cost, we get a distributed architecture that has high download speeds all over the world rather than just locally from whatever box we would happen to be hosting on.


  7. Checking spring-webmvc-2.1-m4.pom I see that the dependency on Servlet API is scoped as 'provided'. Why is the provided scope? I am trying to compile something with maven with simple dependency on spring-webmvc-2.1-m4, but it fails because maven assumes I provide that jar, so it doesn't download it. I understand that typical web apps will provide the Servlet API, but they can (and should) create the 'provided' dependency, not you. Any advice?


  8. [quote post=\"221\"] but it fails because maven assumes I provide that jar, so it doesn\'t download it.[/quote]

    To quote from the Maven documentation:

    [quote]provided - this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive.[/quote]

    So if we were to build Spring with Maven, it would download the servlet-api for us to compile against, but if you depend on Spring, it does not come along as a transitive dependency. If you\'re getting a compile error, it\'s because your code depends on the servlet-api directly and you should declare it as a direct dependency in your POM. In this case, I\'d recommend that you declare your servlet-api dependency as \'provided\' as well as the container will provide it at runtime.

    This is true for all of your direct dependencies of course. You should never take advantage of the side effects of transitive dependency resolution, you never know when those dependencies will change underneath you. :)


  9. Ok. I didn't understand what 'transitive' here meant. Thanks for helping.


  10. Ben,

    Thanks - I'm looking forward to the nightly build support. In the meantime, what's the recommended approach for getting hold of them? Build from source?


  11. [quote comment="50515"]Ben,

    What's the recommended approach for getting hold of [nightly builds]?[/quote]

    Just figured this out (thanks, Ramnivas): http://static.springframework.org/downloads/nightly/snapshot-download.php?project=SPR


  12. [quote post="221"]Thanks - I'm looking forward to the nightly build support. In the meantime, what's the recommended approach for getting hold of them?[/quote]

    If you download the -with-dependencies snapshots, there is a `maveninstall` target that will actually install the artifacts to your local maven repo as well.


  13. [quote post="221"]If you download the -with-dependencies snapshots, there is a `maveninstall` target that will actually install the artifacts to your local maven repo as well.[/quote]
    That was very helpful, Ben. Just saved me a bunch of time, thanks.


  14. Hi,

    i tried to get spring-javaconfig 1.0-m3-SNAPSHOT but it doesnt work.
    My repository-section in pom.xml

    spring-s3-snapshots
    default
    http://s3.amazonaws.com/maven.springframework.org/snapshot

    spring-milestone
    Spring Portfolio Milestone Repository
    http://s3.amazonaws.com/maven.springframework.org/milestone

    My dependencies-section:

    org.springframework.javaconfig
    spring-javaconfig
    1.0-m3-SNAPSHOT

    Did i miss something.
    Browsing is possible and i see the files, but maven can not download it.

    Thanks
    Jörg


  15. Great with the sources. Since I use 2.0.x, and will for a long time, I would really appreciate if you uploaded sources to the 2.0.x versions as well.

    Regards


  16. Well, the 2.0 branch doesn't actually build individual source packages so it's very problematic for us to add them (basically I do it by hand when I have to) so I don't think that 2.0 will ever get anything other than the full JAR sources.

    As Spring 2.5 is intended to be a drop in replacement for 2.0 in most cases, I encourage you to try it once it is released. It and all further releases will will have sources.


  17. When i resolve Spring 2.5 jar and dependencies with ivy from mavenRepo1 i always get a mismatch between the expected and the computed sha1 hashs


  18. http://repo1.maven.org/maven2

    I don't see any repository for spring 2.5 or may be I am blind ?


  19. It's in there with a group id of 'org.springframework'. If you check in the http://repo1.maven.org/maven2/org/springframework/spring area you'll see the JARs themselves.


  20. Hi,

    i use ivy to resolve the spring 2.5 dependencies from http://repo1.maven.org/maven2.
    The thing is that it looks like something is not right with the sha1 hash of the jar.
    I always get
    [ivy:retrieve] WARN: [FAILED ] org.springframework#spring;2.5!spring.jar: invalid sha1: expected=43ee30f7ea8fcdaff8f0e14ce423e7717d7eb776 computed=159082f4e937a9ce4a459703c7fb64f5e6d2a1ee (13446ms) thanks tinko


  21. Hi Ben,

    I'm using Maven 2.0.8 with Spring 2.5.1. Do you know why I needed to explicitly add the dependency for commons-dbcp to my POM? It is already listed in the spring-2.5.1.pom I see in my local repository:

    commons-dbcp
    commons-dbcp
    1.2.2
    true

    … but for some reason, it wasn't brought down with all the other dependencies. When I put it in my own project's POM, it came down fine, along with its dependency commons-pool. Any ideas?

    Thanks,
    Ari


  22. [quote post="221"]Do you know why I needed to explicitly add the dependency for commons-dbcp to my POM?[/quote]

    Many (if not most) of the dependencies in the Spring POM are marked as optional. Maven does not retrieve optional dependencies during transitive dependency resolution.


  23. Ah, I see now — thanks.
    Ari

One trackback

Leave a Reply