Home

Awesome

Mop

Description

Mop is a small utility for executing Java programs which are stored as artifacts like jars or bundles in a Maven repository.

Mop automatically deals with the following for you

Synopsis

Currently supported generic commands:

Command extensions:

Examples

Need to build a script file to start your java application and you having a hard time setting up a class path that contains all the dependencies? Mop can help. Just capture the result of the mop classpath command in the CLASSPATH variable:

$ CLASSPATH=`mop classpath commons-logging:commons-logging:1.1`
$ echo $CLASSPATH
/opt/mop/repository/commons-logging/commons-logging/1.1/commons-logging-1.1.jar
:/opt/mop/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar:/opt/mop/repository/lo
gkit/logkit/1.0.1/logkit-1.0.1.jar:/opt/mop/repository/avalon-framework/avalon-
framework/4.1.3/avalon-framework-4.1.3.jar:/opt/mop/repository/javax/servlet/se
rvlet-api/2.3/servlet-api-2.3.jar

The following example will boot up one of the Apache Camel example programs

mop run org.apache.camel:camel-example-pojo-messaging org.apache.camel.spring.Main

The mop run command takes a maven artifact name then a Java class name along with optional command line arguments. The maven artifact uses the following format

Note that that you can omit the group id, type, classifier and version. You typically may supply just groupId, artifactId, version if you like - or if you really need to specify type (jar/war etc) and classifier if needed.

Project Links