Browse Source

fix #1

- swap back to shade for fat jar packaging
- added ServicesResourceTransformer to shade
master
Jaryl Chng 1 year ago
parent
commit
55285e27a9
10 changed files with 47 additions and 220 deletions
  1. +2
    -1
      .gitignore
  2. +1
    -1
      .gitlab-ci.yml
  3. +0
    -66
      common/dependency-reduced-pom.xml
  4. +5
    -2
      common/src/main/java/com/jarylchng/reactivemongoexample/common/User.java
  5. +0
    -58
      grizzly-jersey/dependency-reduced-pom.xml
  6. +17
    -12
      grizzly-jersey/pom.xml
  7. +0
    -1
      pom.xml
  8. +0
    -58
      undertow-resteasy/dependency-reduced-pom.xml
  9. +22
    -19
      undertow-resteasy/pom.xml
  10. +0
    -2
      undertow-resteasy/src/main/java/com/jarylchng/reactivemongoexample/undertowresteasy/Resource.java

+ 2
- 1
.gitignore View File

@ -1,3 +1,4 @@
.idea/
*.iml
*/target
*/target
*/dependency-reduced-pom.xml

+ 1
- 1
.gitlab-ci.yml View File

@ -15,4 +15,4 @@ build:
- mvn $MAVEN_CLI_OPTS package
artifacts:
paths:
- "*/target/*.jar"
- "*/target/*.jar"

+ 0
- 66
common/dependency-reduced-pom.xml View File

@ -1,66 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>reactive-mongo-examples</artifactId>
<groupId>com.jarylchng</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>common</artifactId>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<inherited>true</inherited>
<configuration>
<source>1.8</source>
<target>1.8</target>
</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>Main</mainClass>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer>
<mainClass>com.jarylchng.reactivemongoexample.common.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
<version>1.0.0.Final</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

+ 5
- 2
common/src/main/java/com/jarylchng/reactivemongoexample/common/User.java View File

@ -29,7 +29,9 @@ public class User {
this.phoneNumber = phoneNumber;
}
public String getUserID() { return userID; }
public String getUserID() {
return userID;
}
public void setUserID(String id) {
this.userID = id;
@ -80,6 +82,7 @@ public class User {
return Single.fromPublisher(collection.insertOne(user));
}
private DAO() { }
private DAO() {
}
}
}

+ 0
- 58
grizzly-jersey/dependency-reduced-pom.xml View File

@ -1,58 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>reactive-mongo-examples</artifactId>
<groupId>com.jarylchng</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>grizzly-jersey</artifactId>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<inherited>true</inherited>
<configuration>
<source>1.8</source>
<target>1.8</target>
</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>com.jarylchng.reactivemongoexample.grizzlyjersey.GrizzlyJersey</mainClass>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer>
<mainClass>com.jarylchng.reactivemongoexample.grizzlyjersey.GrizzlyJersey</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

+ 17
- 12
grizzly-jersey/pom.xml View File

@ -58,28 +58,33 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
<goal>shade</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>
com.jarylchng.reactivemongoexample.grizzlyjersey.GrizzlyJersey
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.jarylchng.reactivemongoexample.grizzlyjersey.GrizzlyJersey</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>

+ 0
- 1
pom.xml View File

@ -20,7 +20,6 @@
<undertow.version>2.0.22.Final</undertow.version>
<resteasy.version>3.8.0.Final</resteasy.version>
<servletresteasy.version>3.0.19.Final</servletresteasy.version>
</properties>
<modules>

+ 0
- 58
undertow-resteasy/dependency-reduced-pom.xml View File

@ -1,58 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>reactive-mongo-examples</artifactId>
<groupId>com.jarylchng</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>undertow-resteasy</artifactId>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<inherited>true</inherited>
<configuration>
<source>1.8</source>
<target>1.8</target>
</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>com.jarylchng.reactivemongoexample.undertowresteasy</mainClass>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer>
<mainClass>com.jarylchng.reactivemongoexample.undertowresteasy.UndertowResteasy</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

+ 22
- 19
undertow-resteasy/pom.xml View File

@ -23,22 +23,21 @@
<artifactId>undertow-servlet</artifactId>
<version>${undertow.version}</version>
</dependency>
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-core</artifactId>
<version>${undertow.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-undertow</artifactId>
<version>${resteasy.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-rxjava2</artifactId>
<version>${resteasy.version}</version>
<scope>com</scope>
</dependency>
</dependencies>
@ -66,33 +65,37 @@
</execution>
</executions>
<configuration>
<mainClass>com.jarylchng.reactivemongoexample.undertowresteasy</mainClass>
<mainClass>com.jarylchng.reactivemongoexample.undertowresteasy.UndertowResteasy</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
<goal>shade</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>
com.jarylchng.reactivemongoexample.undertowresteasy.UndertowResteasy
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.jarylchng.reactivemongoexample.undertowresteasy.UndertowResteasy</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>

+ 0
- 2
undertow-resteasy/src/main/java/com/jarylchng/reactivemongoexample/undertowresteasy/Resource.java View File

@ -8,8 +8,6 @@ import org.jboss.resteasy.annotations.Stream;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
@Path("user")
public class Resource {

Loading…
Cancel
Save