-
Notifications
You must be signed in to change notification settings - Fork 3
Maven packaging
Pierre PINON edited this page Dec 7, 2017
·
12 revisions
<dependencies>
<dependency>
<groupId>org.teknux</groupId>
<artifactId>jetty-bootstrap</artifactId>
<version>x.x.x</version>
</dependency>
</dependencies>
You can use maven-shade-plugin :
<build>
...
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>org.example.Main</Main-Class>
</manifestEntries>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
...
</plugins>
...
</build>
You can copy a war file in your application by using copy-maven-plugin :
<build>
...
<plugins>
...
<plugin>
<groupId>com.github.goldin</groupId>
<artifactId>copy-maven-plugin</artifactId>
<version>0.2.5</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<resources>
<resource>
<targetPath>${project.build.outputDirectory}/webapp</targetPath>
<stripVersion>true</stripVersion>
<dependencies>
<dependency>
<groupId>org.example</groupId>
<artifactId>myapp</artifactId>
<version>1.0.0-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
...
</plugins>
...
</build>
<build>
...
<resources>
<resource>
<filtering>false</filtering>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/webapp</directory>
<targetPath>webapp</targetPath>
<includes>
<include>**</include>
</includes>
</resource>
</resources>
...
</build>
In v1.0.0, JSP Support is already include in jetty-bootstrap artifact
<build>
...
<dependency>
<groupId>org.teknux</groupId>
<artifactId>jetty-bootstrap-jsp</artifactId>
<version>x.x.x</version>
</dependency>
...
</build>
In v1.0.0, Logs Support (Logback implementation) is already include in jetty-bootstrap artifact
<build>
...
<dependency>
<groupId>org.teknux</groupId>
<artifactId>jetty-bootstrap-logs</artifactId>
<version>x.x.x</version>
</dependency>
...
</build>
<build>
...
<dependency>
<groupId>org.teknux</groupId>
<artifactId>jetty-bootstrap-annotations</artifactId>
<version>x.x.x</version>
</dependency>
...
</build>
<dependency>
<groupId>org.teknux</groupId>
<artifactId>jetty-bootstrap-standalone</artifactId>
<version>x.x.x</version>
</dependency>
<build>
...
<dependency>
<groupId>org.teknux</groupId>
<artifactId>jetty-bootstrap-websocket</artifactId>
<version>x.x.x</version>
</dependency>
...
</build>
<build>
...
<dependency>
<groupId>org.teknux</groupId>
<artifactId>jetty-bootstrap-servlets</artifactId>
<version>x.x.x</version>
</dependency>
...
</build>