Skip to content

Commit

Permalink
Add a new servlet logging module supporting jakarta.* packages. (#153)
Browse files Browse the repository at this point in the history
* Added jakarta servlet module
* maintain dependency versions in root pom.xml
---------

Co-authored-by: Harald Aamot <[email protected]>
  • Loading branch information
mofterdinger and aamotharald authored Feb 27, 2023
1 parent c7acbca commit c8f4f2a
Show file tree
Hide file tree
Showing 3 changed files with 240 additions and 6 deletions.
213 changes: 213 additions & 0 deletions cf-java-logging-support-servlet-jakarta/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>cf-java-logging-support-servlet-jakarta</artifactId>
<packaging>jar</packaging>

<name>cf-java-logging-support-servlet-jakarta</name>
<parent>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-parent</artifactId>
<version>3.6.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

<properties>
<servlet.api.version>5.0.0</servlet.api.version>
<maven-dependency-plugin.version>3.5.0</maven-dependency-plugin.version>
<build-helper-maven-plugin.version>3.3.0</build-helper-maven-plugin.version>
<jetty.version>11.0.13</jetty.version>
</properties>

<dependencies>
<!-- servlet api -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${servlet.api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-core</artifactId>
<version>${project.version}</version>
</dependency>
<!-- we need our logback implementation for testing! -->
<dependency>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-logback</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
<scope>test</scope>
</dependency>
<!-- Library for token signing/verification -->
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>${java-jwt.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-databind.version}</version>
</dependency>

<!-- testing -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>${jetty.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven-dependency-plugin.version}</version>
<executions>
<execution>
<id>unpack</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>cf-java-logging-support-servlet</artifactId>
<version>${project.version}</version>
<type>jar</type>
<classifier>sources</classifier>
<overWrite>false</overWrite>
<outputDirectory>target/generated-sources/java</outputDirectory>
<includes>**/*.java</includes>
</artifactItem>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>cf-java-logging-support-servlet</artifactId>
<version>${project.version}</version>
<type>jar</type>
<classifier>test-sources</classifier>
<overWrite>false</overWrite>
<outputDirectory>target/generated-test-sources/java</outputDirectory>
<includes>**/*.java</includes>
</artifactItem>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>cf-java-logging-support-servlet</artifactId>
<version>${project.version}</version>
<type>jar</type>
<classifier>test-sources</classifier>
<overWrite>false</overWrite>
<outputDirectory>target/generated-test-sources/resources</outputDirectory>
<includes>**/logback-test.xml</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin.version}</version>
<executions>
<execution>
<id>add-generated-sources</id>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-generated-test-sources</id>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-test-sources/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-generated-test-resources</id>
<goals>
<goal>add-test-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>target/generated-test-sources/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-sources</phase>
<configuration>
<tasks>
<!-- replace javax.servlet with jakarta.servlet in generated-sources -->
<replace dir="target/generated-sources/java"
token="javax.servlet" value="jakarta.servlet">
<include name="**/*.java" />
</replace>
<!-- replace javax.servlet with jakarta.servlet in generated-test-sources -->
<replace dir="target/generated-test-sources/java"
token="javax.servlet" value="jakarta.servlet">
<include name="**/*.java" />
</replace>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>

</plugins>
</build>
</project>
29 changes: 23 additions & 6 deletions cf-java-logging-support-servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<properties>
<servlet.api.version>3.1.0</servlet.api.version>
<jetty.version>9.4.49.v20220914</jetty.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -47,33 +48,49 @@
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.18.2</version>
<version>${java-jwt.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.4.1</version>
<version>${jackson-databind.version}</version>
</dependency>

<!-- testing -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>9.4.49.v20220914</version>
<version>${jetty.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>9.4.49.v20220914</version>
<version>${jetty.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
<version>${httpclient.version}</version>
<scope>test</scope>
</dependency>

</dependencies>
</project>

<build>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar</goal>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,17 @@
<javadoc.plugin.version>3.1.1</javadoc.plugin.version>
<gpg.plugin.version>1.6</gpg.plugin.version>
<maven.compiler.release>8</maven.compiler.release>
<java-jwt.version>3.18.2</java-jwt.version>
<jackson-databind.version>2.13.4.1</jackson-databind.version>
<httpclient.version>4.5.13</httpclient.version>
</properties>

<modules>
<module>cf-java-logging-support-core</module>
<module>cf-java-logging-support-logback</module>
<module>cf-java-logging-support-log4j2</module>
<module>cf-java-logging-support-servlet</module>
<module>cf-java-logging-support-servlet-jakarta</module>
<module>cf-java-logging-support-jersey</module>
<module>cf-java-monitoring-custom-metrics-clients</module>
<module>sample</module>
Expand Down

0 comments on commit c8f4f2a

Please sign in to comment.