maven - Eclipse run configuration with complete package name of selected resource as variable -


i running maven project eclipse , want setup run configuration goals compile exec:java, needs exec.mainclass parameter. because have different main classes in project, class , package name selected resource used when running. correct run variable insert value parameter?

i use following configuration run main method of selected class. know asked parameters i'll provide more detailed steps other visitors since didn't found solution on net.

prerequisite: m2e eclipse plugin, exec-maven-plugin

  1. select run > maven build …
  2. use goal exec:java
  3. optional: provide profile name
  4. optional: select debug output
  5. click add … create parameter
    • name: exec.mainclass
    • value: ${java_type_name} (this provides selected resource's full java name)

now whenever use run configuration take current class parameter , execute main method. ${java_type_name} variable provided eclipse, should work somehow without using m2e.

one thing mention exec.mainclass parameter didn't work me when provided goal , default configuration in pom.xml. not sure if it's bug, did wrong, or not possible. had remove goals , include plugin without configuring in build make work:

<plugin>     <groupid>org.codehaus.mojo</groupid>     <artifactid>exec-maven-plugin</artifactid>     <version>1.2.1</version> </plugin> 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -