Skip to content

Instantly share code, notes, and snippets.

@ShmuelMofrad
Created November 29, 2017 19:40
Show Gist options
  • Save ShmuelMofrad/083ac764ba446f8a4b85f1c5e1cdea7e to your computer and use it in GitHub Desktop.
Save ShmuelMofrad/083ac764ba446f8a4b85f1c5e1cdea7e to your computer and use it in GitHub Desktop.
Maven - single project without dependencies.

Maven single project without dependencies.

build single project without dependencies

add this in your pom.xml

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
        <configuration>
          <archive>
            <manifest>
              <mainClass>one.unus.app.App</mainClass>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              <addClasspath>true</addClasspath>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment