Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-1621

Creating a jar project with Main should generate an exec-maven-plugin in pom.xml

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Minor Minor
    • 3.x Future
    • 2.1.1.Final
    • Build Tools - Maven
    • None

      When creating a project with a Main class :

      project-new --named mainproj --type jar --createMain
      

      It would be good to have, in the pom.xml, a generated exec-maven-plugin so that we could execute the Main class with a simple mvn exec:java command :

      <?xml version="1.0" encoding="UTF-8"?>
      <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <modelVersion>4.0.0</modelVersion>
        <groupId>org.mainproj</groupId>
        <artifactId>mainproj</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <build>
          <plugins>
            <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>3.1</version>
              <configuration>
                <source>1.7</source>
                <target>1.7</target>
                <encoding>UTF-8</encoding>
              </configuration>
            </plugin>
      
      <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>exec-maven-plugin</artifactId>
              <version>1.2.1</version>
              <executions>
                <execution>
                  <goals>
                    <goal>java</goal>
                  </goals>
                </execution>
              </executions>
              <configuration>
                <mainClass>org.mainproj.Main</mainClasss>
              </configuration>
            </plugin>
          </plugins>
        </build>
      </project>
      

      See : http://mojo.codehaus.org/exec-maven-plugin/index.html

              Unassigned Unassigned
              agoncal Antonio Goncalves (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: