It’s a fundamental tenet of Maven that release artifacts never change once they are released. This is enforced in Maven by the fact that once a release artifact or POM is located in the local repository, Maven will never check for an updated artifact in a remote repository. Once an artifact is released, it is considered a static, unchanging artifact. If you release an artifact and then subsequently change it (intentionally or otherwise), you’re in for some fun as people will have different versions based on when they first retrieved it… that’s a situation not exactly conducive to a repeatable, standard build. This blog post discusses a feature in Nexus 1.4 which can enforce this rule and help you avoid problems caused by the redeployment of release artifacts.
We’ve made a small, but important change to the front page of http://repository.sonatype.org. (You might recognize the design.)
To search for an library or an artifact:
- Go to http://repository.sonatype.org
- Type in an artifact or group identifier, a class name, or a checksum.
- Press Enter.
Once you have located the artifact you were looking for, click on the artifact and copy the dependency XML from Nexus to your POM. It couldn’t get any easier or intuitive. Make sure to bookmark http://repository.sonatype.org.
The m2eclipse plugin allows you to browse and manipulate repository indexes. Using the Maven Repository view in m2eclipse you can:
- Browse your Local Maven repository
- Browse global repositories such as the Central Maven repository
- Browse a repository which captures artifacts generated by Maven projects in your Eclipse workspace
- Rebuild a Nexus Index from scratch
- Update a Nexus Index with incremental changes
- Modify the scope of repository indexing with a “minimal” or “full” index
- Disable Indexing for a repository
- Materialize a Maven project from information stored in a POM
For more information about this new view, see Browsing and Manipulating Maven Repositories in Edition 0.6 of Developing with Eclipse and Maven. Read on to find out how to open this view in m2eclipse.
New to the Professional version is OSGI Bundle Repository support. Stuart summed it up nicely in his detailed post:
…but how does this relate to Nexus Professional? Well with Nexus Pro 1.3.5 you will be able to:
- dynamically generate OBR metadata for your existing repositories
- proxy and cache remote OBRs, including both metadata and bundles
- host local OBRs and deploy bundles into them using the UI or Maven
- group all of the above types of OBRs into a single merged OBR
- apply CRUD privileges to control access to particular bundles
Basically the same things you can do with Maven and P2 repositories you can now do with OBR!
Other than the new OBR plugin, this release was primarily to fix some bugs that cropped up since the 1.3.4 release a few weeks ago. We deem these fixes important and recommend everyone upgrade to the latest release.
If your project’s artifacts are published to the Central Repository it is trivial for your users to add a dependency and start using your project’s library or framework, but if your project is hosted somewhere like Sourceforge and there is no repository manager or repository setup for synchronizing to the Central Repository, getting your artifacts into Central can be a pain. The old process for publishing your artifacts to Central required several manual steps for you and for the Maven team to setup and enable an rsync location… assuming you can find a location to host your files at all.
At Sonatype, we want to make synchronizing and publishing your artifacts to Central easier both for you and for us, and we want to improve the quality of repository metadata for everyone at the same time. We have set up a dedicated instance of Sonatype Pro for Nexus at http://oss.sonatype.org specifically to host the artifacts of other Open Source projects. In this post, I talk about the process of creating a repository for your open source projects and publishing artifacts so that they will be available from the Central Repository.