On Sep 19, 2005, at 5:58 PM, Ashley Williams wrote:

Is there currently a java plugin for running regular main() apps? I've just checked the repository and I couldn't find one. Currently I define the following plugin in my pom:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <mainClass>Server</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
    </plugins>

and would like to do something like this to run the app:
m2 java:java

but at the moment I have to do this:
java -jar file://<myrepository>/<myartifact>/myapp.jar

In fact I'd ideally like to run the app immediately after the install:
m2 install java:java

Hi,

I've been thinking about the same thing. It would be nice to be able to just run the jar file with the correct dependencies in the classpath directly.

There's a plugin at org.codehaus.mojo called maven-execute-plugin (in the sandbox), which does something like this (I don't know if it currently works). From the docs: "A useful little plugin for leveraging maven to build the required classpath to execute the main method on an object." With an example for running it directly (can also be configured in the POM): "m2 execute:resources - Dexecute.class="com.foo.X" -Dexecute.args="-h bar".

For this you would need an additional plugin (execute), why not just put this functionality into the jar plugin? So no more configuration is needed. It might be the wrong place for it, I don't know, but it would be nice to just write "m2 jar:run" =)

--
Regards,
Kristian


Thanks
AW

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to