MAVEN


Home  | About me

Creating executable jar using jar plugin:

    Add entry for jar-plugin and assembly-plugin inside the <build> tag of pom.xml ,

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <mainClass>org.sarovar.jsudoku.MainClass</mainClass>
              <packageName>org.sarovar.jsudoku</packageName>
              <addClasspath>true</addClasspath>
              <classpathPrefix/>
            </manifest>
            <manifestEntries>
              <mode>development</mode>
              <url>${pom.url}</url>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <mainClass>org.sarovar.jsudoku.MainClass</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
 

$ mvn assembly:assembly -DdescriptorId=jar-with-dependencies