-
Notifications
You must be signed in to change notification settings - Fork 50
Add a new servlet logging module supporting jakarta.* packages. #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6d37abd
4831e15
44b19d3
b0eba3c
1f05634
b9d6c69
eada4a1
2a975b3
8cd000e
f2191ca
d0c379e
cc97c18
4d679cc
29d1095
530d3e7
4eae1ed
c663739
e464de9
a07b4f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
|
||
<properties> | ||
<servlet.api.version>3.1.0</servlet.api.version> | ||
<jetty.version>9.4.49.v20220914</jetty.version> | ||
</properties> | ||
|
||
<dependencies> | ||
|
@@ -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> | ||
Comment on lines
+88
to
+89
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this created more artefacts, that will be uploaded to Maven Central. Note, that in the parent pom.xml, there is the "ossrh" profile, that creates, signs and uploads the artefacts. This already contains a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could be right, that could really a problem. If you have look into the target folder of this module, it contains 2 additional jars. Can somehow control which artifacts are uploaded to Maven central? Do you have something like an artifact or module list? To be honest I'm not familiar with this upload. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tested the publishing. It almost looks fine, but for the jar, that contains the sources. It does not exists, since its execution phase is so early in the Maven lifecycle, that all the actions for providing the correct code come afterwards. I will add the required configuration, once this PR is merged. Without a sources jar, Maven Central would reject this project. |
||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the benefit of building and using a jar compared to accessing the folder directly? The code will always be built together, won't it?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The benefit is from my point of view, that the maven-dependency-plugin does the job to provide and extract the source code. We don't have to care about the project structure to find the sources and copy them into this module. I assume this can be also done, but I don't know how to do this with maven.