So you want a resource uploaded to Maven's central repo?
To save time for everybody, here is how you go about it.
Use the artifact plugin, provided with the standard Maven distribution, to create an upload bundle:
maven artifact:create-upload-bundle
The bundle will be created in your "target" directory of the form:
${pom.artifactId}-${pom.currentVersion}-bundle.jar
If you are not using maven as your build system but want something
uploaded to central repo, then you just need to make a JAR (using the jar
executable, not zip
, pkzip
or equivalent) with the following
format:
LICENSE.txt project.xml foo-1.0.jar (or whatever artifact is referred to in the project.xml)
Note that the bundle will be read by a script, so it must follow the above format. Also,
the project.xml
should at least contain the following elements:
Some considerations about the groupId: it will identify your project uniquely across all projects, so we need to enforce a naming schema. For projects with artifacts already uploaded to central repo it can be equal to the previous used, but for new projects it has to follow the package name rules, what means that has to be at least as a domain name you control, and you can create as many subgroups as you want. More information about package names.
Examples:
You can request a upload for a maven 2 project just using the maven 2 pom.xml instead of the maven 1 project.xml referenced previously. The jar will be uploaded to both maven 1 and maven 2 repos. Check this mini guide for more information.
Post your request to JIRA. In the description you should write the URL of the upload bundle (if you're uploading more than one bundle please add all the urls under the same issue), then leave a blank line and provide the following:
This will speed up the uploading process.
You can place any additional comments you wish in the following paragraph. So the
description field might look like:
http://wiggle.sourceforge.net/downloads/wiggle-1.0-bundle.jar http://wiggle.sourceforge.net http://wiggle.sourceforge.net/team-list.html Wiggle is a fantastic new piece of software for automating the clipping of nose hairs. Please upload!
Some folks have asked why do we require the POM and license each time an artifact is deployed so here's a small explanation. The POM being deployed with the artifact is part of the process to make transitive dependencies a reality in Maven. The logic for getting transitive dependencies working is really not that hard, the problem is getting the data. So we have changed the process of uploading artifacts to include the POM in an attempt to get transitive dependencies working as quickly as possible. The other applications that may be possible having all the POMs available for artifacts are vast, so by placing them into the repository as part of the process we open up the doors to new ideas that involve unified access to project POMs.
We also ask for a license now because it is possible that your project's license may change in the course of its life time and we are trying create tools to help normal people sort out licensing issues. For example, knowing all the licenses for a particular graph of artifacts we could have some strategies that would identify potential licensing problems.