maven gem plugin
beside there main gem:gem there are some wrappers like gem:list, gem:spec. the gem:build, gem:gemify are experimatal goal which might lead to replacement of the default package and install goal for gem artifacts.
demo of gemify a jar pom
in the demo directory of the source is minimal pom.xml which allows the usage of the plugin with automatic installation (of the plugin) and short goals. just go into that directory and execute the following commands. the gem_home and gem_path are set to be the demo directory itself.
mvn de.saumya.mojo:gem-maven-plugin:gemify -DartifactId=avalon-framework-impl -DgroupId=org.apache.avalon.framework -Dversion=4.3.1
mvn de.saumya.mojo:gem-maven-plugin:gemify -DartifactId=avalon-framework-impl -DgroupId=avalon-framework -Dversion=4.3
mvn de.saumya.mojo:gem-maven-plugin:gemify -DartifactId=guice -DgroupId=com.google.code.guice -Dversion=1.0
this gem:gemify goal can handle all kinds of pom.xml with inherited dependencies, version and groupId from parent pom or shared dependencies via external pom artifact. or sometimes you find version set via properties, either from the pom itself or the parent pom. of course all the repositories which are configured in the pom or setting.xml do work either legacy or default layout. all the proxy settings are obeyed as well. in the end the whole plugin is just a little plugin with in the maven infrastructure.
the relocation of the pom gets processed before determine the “gem-name”, i.e. all the deprecated location will not be used by the gems.
it is tested against maven-2.2.1 and maven-3.0-alpha-5
next generation plugin (work in progress)
most of the goal take arguments via the commandline like
where the XYZ is the goal. but all these goals take as a shortcut an extra -Dargs= argument. in some situation you want to distinguise the arguments for the different goals then take the long argument
All goals take the arguments from -Dgem.args=
Some goals have goal specific arguments as well.
- gem:gem – gem command with -Dgem.args=
- gem:list – gem list command with -Dgem.list=
- gem:spec – gem spec command with -Dgem.spec=
- gem:install – gem install command with -Dgem.install=
to be implemented
- gem:environment – gem environment command with -Dgem.environment=
- gem:uninstall – gem uninstall command with -Dgem.uninstall=
- gem:build – gem build command with -Dgem.build=
gemcutter wrapper (to be implemented)
- gem:push – deploys gem onto gemcutter with -Dgem.push= and -Dgem.push=
- gem:owner – owners of gemcutter -Dgem.owner=
gem with pom first
these goals need a pom !
- gem:initialize – downloads all gems from gemcutter and install it in the local maven repository and install it on the local rubygems repository (this needs maven3 which can work with custom repository layout)
- gem:package – use the pom to build a gem-artifact
- gem:install – installs locally the packed gem in rubygems (if pom is present and no args for gem:install are given)
- gem:gemify – builds and/or install gem for the given jar-artifact (including all dependent jars). artifact either comes from the pom or via the commandline properties (aritfactId,groupId,version)
gem as artifact – gemspec first
these goals must not have a pom !
- gem:package – takes a gemspec and builds the gem. use -Dgemspec=
to be implemented
- gem:install-as-artifact – generate a pom out of the gemspec and install the gem artifact in the local maven repository. use -Dgem.install=
- gem:deploy-as-artifact – generate a pom out of the gemspec and deploy the gem artifact on a remote maven repository. use -Dgem.deploy=