Maven 2.x Exec Plugin

exec plugin should be able to run the main class from a jar if the class if not specified and one exists

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.0.2
  • Fix Version/s: None
  • Component/s: java
  • Labels:
    None
  • Number of attachments :
    0

Activity

Hide
Jerome Lacoste added a comment -

Brett, you want a way to execute a jar and not a class ?

If so, do you want something like:

mvn exec:java -Djar=groupId:artifactId

or

mvn exec:java -Djar=/path/to/my/jar

both ?

Show
Jerome Lacoste added a comment - Brett, you want a way to execute a jar and not a class ? If so, do you want something like: mvn exec:java -Djar=groupId:artifactId or mvn exec:java -Djar=/path/to/my/jar both ?
Hide
Jerome Lacoste added a comment -

I will guess that we need something like:

mvn exec:java -DjarArtifact=/path/to/my/jar

and

mvn exec:java -Djar=groupId:artifactId

can the one watching this issue give some feedback ?

Show
Jerome Lacoste added a comment - I will guess that we need something like: mvn exec:java -DjarArtifact=/path/to/my/jar and mvn exec:java -Djar=groupId:artifactId can the one watching this issue give some feedback ?
Hide
jieryn added a comment -

Why can't you simply:

if (jar != null) {
if (jar.indexOf(":") > 0) { parseGAVThenRun(jar); } else {
File jarAbsolute;
File jarFile = new File(jar);
if (jarFile.isAbsolute()) { jarAbsolute = jarFile; }
else { jarAbsolute = new File(basedir, jar); }

runManifestMain(jarAbsolute);
}
}

This may seem like a lot of effort to automatically detect what the user is trying to do, but I think it makes this plugin path quite a bit nicer.

Show
jieryn added a comment - Why can't you simply: if (jar != null) { if (jar.indexOf(":") > 0) { parseGAVThenRun(jar); } else { File jarAbsolute; File jarFile = new File(jar); if (jarFile.isAbsolute()) { jarAbsolute = jarFile; } else { jarAbsolute = new File(basedir, jar); } runManifestMain(jarAbsolute); } } This may seem like a lot of effort to automatically detect what the user is trying to do, but I think it makes this plugin path quite a bit nicer.

People

Vote (2)
Watch (2)

Dates

  • Created:
    Updated: