Skip to content

Commit

Permalink
Fixes #3741 - Move Eclipse Yasson dependency and its usage into a Pir…
Browse files Browse the repository at this point in the history
…anha Extension module (#3742)
  • Loading branch information
mnriem authored May 29, 2024
1 parent fcbfe46 commit 1c695ee
Show file tree
Hide file tree
Showing 15 changed files with 183 additions and 51 deletions.
1 change: 1 addition & 0 deletions COMPONENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
|-----------------------|---------------|
| Eclipse Grizzly | 4.0.2 |
| Eclipse Grizzly NPN | 2.0.0 |
| Eclipse Yasson | 3.0.3 |
| Netty | 4.1.108.Final |
| Project CRaC | 0.1.3 |
| RedHat Undertow | 2.3.12.Final |
Expand Down
11 changes: 6 additions & 5 deletions extension/coreprofile/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,26 @@
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-naming</artifactId>
<artifactId>piranha-extension-eclipse-yasson</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-redhat-weld</artifactId>
<artifactId>piranha-extension-naming</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-scinitializer</artifactId>
<artifactId>piranha-extension-redhat-weld</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-scinitializer</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
3 changes: 1 addition & 2 deletions extension/coreprofile/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,5 @@
requires cloud.piranha.extension.jersey;
requires cloud.piranha.extension.naming;
requires cloud.piranha.extension.scinitializer;
requires org.eclipse.parsson;
requires org.eclipse.yasson;
requires cloud.piranha.extension.yasson;
}
42 changes: 42 additions & 0 deletions extension/eclipse-yasson/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>cloud.piranha.extension</groupId>
<artifactId>project</artifactId>
<version>24.6.0-SNAPSHOT</version>
</parent>

<artifactId>piranha-extension-eclipse-yasson</artifactId>
<packaging>jar</packaging>

<name>Piranha - Extension - Eclipse Yasson</name>
<properties>
<yasson.version>3.0.3</yasson.version>
</properties>
<dependencies>
<!-- compile -->
<dependency>
<groupId>cloud.piranha.core</groupId>
<artifactId>piranha-core-api</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<!-- provided -->
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-scinitializer</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<!-- runtime -->
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
<version>${yasson.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright (c) 2002-2024 Manorrock.com. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package cloud.piranha.extension.yasson;

import cloud.piranha.core.api.WebApplication;
import cloud.piranha.core.api.WebApplicationExtension;
import java.lang.System.Logger;
import static java.lang.System.Logger.Level.TRACE;

/**
* The extension that delivers Eclipse Yasson to Piranha.
*
* @author Manfred Riem ([email protected])
*/
public class YassonExtension implements WebApplicationExtension {

/**
* Stores the logger.
*/
private static final Logger LOGGER = System.getLogger(YassonExtension.class.getName());

/**
* Configure the extension.
*
* @param webApplication the web application.
*/
@Override
public void configure(WebApplication webApplication) {
LOGGER.log(TRACE, "Configuring Yasson extension");
}
}
44 changes: 44 additions & 0 deletions extension/eclipse-yasson/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (c) 2002-2024 Manorrock.com. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

/**
* This module delivers the Eclipse Yasson integration extension.
*
* <p>
* This extension integrates Eclipse Yasson into Piranha. See
* https://github.com/eclipse-ee4j/yasson for more information about its
* project.
* </p>
*
* @author Manfred Riem ([email protected])
*/
module cloud.piranha.extension.yasson {

requires cloud.piranha.core.api;
requires static cloud.piranha.extension.scinitializer;
}
17 changes: 7 additions & 10 deletions extension/micro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<artifactId>piranha-core-impl</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-apache-fileupload</artifactId>
Expand Down Expand Up @@ -71,6 +70,12 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-eclipse-yasson</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-policy</artifactId>
Expand All @@ -82,7 +87,6 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<!-- RedHat Weld -->
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-redhat-weld</artifactId>
Expand Down Expand Up @@ -111,7 +115,7 @@
<artifactId>piranha-extension-tempdir</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-webxml</artifactId>
Expand Down Expand Up @@ -154,13 +158,6 @@
<scope>runtime</scope>
</dependency>

<!-- Jakarta JSON Binding implementation -->
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
<scope>runtime</scope>
</dependency>

<!-- Jakarta Validation API -->
<dependency>
<groupId>jakarta.validation</groupId>
Expand Down
12 changes: 6 additions & 6 deletions extension/microprofile/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,26 @@
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-naming</artifactId>
<artifactId>piranha-extension-eclipse-yasson</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<!-- RedHat Weld -->
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-redhat-weld</artifactId>
<artifactId>piranha-extension-naming</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-scinitializer</artifactId>
<artifactId>piranha-extension-redhat-weld</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-scinitializer</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
3 changes: 1 addition & 2 deletions extension/microprofile/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,5 @@
requires cloud.piranha.extension.jersey;
requires cloud.piranha.extension.naming;
requires cloud.piranha.extension.scinitializer;
requires org.eclipse.parsson;
requires org.eclipse.yasson;
requires cloud.piranha.extension.yasson;
}
11 changes: 6 additions & 5 deletions extension/platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
<artifactId>piranha-extension-eclipse-jersey</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-eclipse-yasson</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
Expand All @@ -68,10 +74,5 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
3 changes: 1 addition & 2 deletions extension/platform/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,5 @@
requires cloud.piranha.extension.jersey;
requires cloud.piranha.extension.naming;
requires cloud.piranha.extension.scinitializer;
requires org.eclipse.parsson;
requires org.eclipse.yasson;
requires cloud.piranha.extension.yasson;
}
1 change: 1 addition & 0 deletions extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<module>eclipse-jersey</module>
<module>eclipse-mojarra</module>
<module>eclipse-soteria</module>
<module>eclipse-yasson</module>
<module>eclipse-wasp</module>
<module>eclipselink</module>
<module>hazelcast</module>
Expand Down
8 changes: 0 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
<spring-boot.version>3.2.3</spring-boot.version>
<transact-cdi-beans.version>1.0.1</transact-cdi-beans.version>
<tyrus.version>2.1.5</tyrus.version>
<yasson.version>3.0.3</yasson.version>
<!-- plugins -->
<build-helper-maven-plugin.version>3.5.0</build-helper-maven-plugin.version>
<clirr-maven-plugin.version>2.8</clirr-maven-plugin.version>
Expand Down Expand Up @@ -234,13 +233,6 @@
<artifactId>tyrus-container-servlet</artifactId>
<version>${tyrus.version}</version>
</dependency>

<!-- Eclipse Yasson -->
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
<version>${yasson.version}</version>
</dependency>

<!-- Freeport Finder -->
<dependency>
Expand Down
11 changes: 5 additions & 6 deletions test/debug/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@
<artifactId>piranha-extension-eclipse-soteria</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-eclipse-yasson</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-eclipse-wasp</artifactId>
Expand Down Expand Up @@ -428,12 +433,6 @@
<artifactId>tyrus-container-servlet</artifactId>
</dependency>

<!-- Eclipse Yasson -->
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
</dependency>

<!-- Freeport Finder -->
<dependency>
<groupId>me.alexpanov</groupId>
Expand Down
11 changes: 6 additions & 5 deletions test/embedded/eclipselink/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-eclipse-yasson</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-naming</artifactId>
Expand Down Expand Up @@ -106,11 +112,6 @@
<artifactId>jakarta.websocket-client-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Expand Down

0 comments on commit 1c695ee

Please sign in to comment.