Skip to content

Commit

Permalink
Merge pull request #41 from tmonney/jakarta
Browse files Browse the repository at this point in the history
Upgrade to MicroProfile 5.0
  • Loading branch information
phillip-kruger authored Jun 1, 2023
2 parents 218c057 + 0199769 commit 1b6b1ed
Show file tree
Hide file tree
Showing 63 changed files with 181 additions and 363 deletions.
2 changes: 1 addition & 1 deletion config-events/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.microprofile-ext</groupId>
<artifactId>config-ext</artifactId>
<version>2.0.2-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<groupId>org.microprofile-ext.config-ext</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.Initialized;
import javax.enterprise.event.Event;
import javax.enterprise.event.Observes;
import javax.inject.Inject;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.context.Initialized;
import jakarta.enterprise.event.Event;
import jakarta.enterprise.event.Observes;
import jakarta.inject.Inject;

/**
* Easy way to fire a change event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import java.lang.annotation.Documented;
import java.lang.annotation.Target;
import javax.inject.Qualifier;
import jakarta.inject.Qualifier;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.enterprise.util.AnnotationLiteral;
import jakarta.enterprise.util.AnnotationLiteral;

/**
* Filter the event on the key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import java.lang.annotation.Documented;
import java.lang.annotation.Target;
import javax.inject.Qualifier;
import jakarta.inject.Qualifier;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.enterprise.util.AnnotationLiteral;
import jakarta.enterprise.util.AnnotationLiteral;

/**
* Filter by config source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import java.lang.annotation.Documented;
import java.lang.annotation.Target;
import javax.inject.Qualifier;
import jakarta.inject.Qualifier;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.enterprise.util.AnnotationLiteral;
import jakarta.enterprise.util.AnnotationLiteral;

/**
* filter by change type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.enterprise.util.Nonbinding;
import javax.interceptor.InterceptorBinding;
import jakarta.enterprise.util.Nonbinding;
import jakarta.interceptor.InterceptorBinding;

/**
* an interceptor that match the value to a regular expression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Priority;
import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;
import jakarta.annotation.Priority;
import jakarta.interceptor.AroundInvoke;
import jakarta.interceptor.Interceptor;
import jakarta.interceptor.InvocationContext;
import org.microprofileext.config.event.ChangeEvent;

@RegexFilter(value = "")
Expand Down
4 changes: 2 additions & 2 deletions config-events/src/main/resources/META-INF/beans.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_3_0.xsd"
bean-discovery-mode="all">
</beans>
125 changes: 10 additions & 115 deletions config-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<groupId>org.microprofile-ext.config-ext</groupId>
<artifactId>config-example</artifactId>
<packaging>war</packaging>
<version>2.0.2-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>

<name>Microprofile Config Extensions :: Example</name>
<description>A basic Example of these extensions</description>

<properties>
<failOnMissingWebXml>false</failOnMissingWebXml>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<microProfile.version>4.0.1</microProfile.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<microProfile.version>5.0</microProfile.version>

<!-- Our own config files -->
<config.yaml>file:${basedir}${file.separator}src${file.separator}main${file.separator}resources${file.separator}examples${file.separator}config.yaml,file:${basedir}${file.separator}src${file.separator}main${file.separator}resources${file.separator}examples${file.separator}config_prod.yaml,http://localhost/config.yaml</config.yaml>
Expand Down Expand Up @@ -89,7 +89,7 @@
<dependency>
<groupId>org.microprofile-ext.openapi-ext</groupId>
<artifactId>openapi-ui</artifactId>
<version>1.1.4</version>
<version>2.0.0</version>
<scope>runtime</scope>
</dependency>

Expand All @@ -100,112 +100,7 @@
</build>

<profiles>

<!-- Run Thorntail -->
<profile>
<id>thorntail</id>
<activation>
<property>
<name>thorntail</name>
</property>
</activation>

<properties>
<thorntail.version>2.3.0.Final</thorntail.version>
<thorntail.configDir>${basedir}${file.separator}src${file.separator}main${file.separator}resources</thorntail.configDir>
</properties>

<build>
<plugins>

<!--To configure thorntail-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>add-resource</id>
<phase>generate-resources</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<!--thorntail config-->
<resource>
<directory>${thorntail.configDir}</directory>
<targetPath>${project.build.directory}</targetPath>
<filtering>true</filtering>
<includes>
<include>project*.yml</include>
<include>*.properties</include>
</includes>
</resource>

</resources>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>io.thorntail</groupId>
<artifactId>thorntail-maven-plugin</artifactId>
<version>${thorntail.version}</version>
<executions>
<execution>
<id>2</id>
<phase>pre-integration-test</phase>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
<configuration>
<properties>
<thorntail.context.path>/${project.build.finalName}</thorntail.context.path>
</properties>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>1</id>
<phase>post-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<arguments>
<argument>-jar</argument>
<argument>${project.build.directory}${file.separator}${project.build.finalName}-thorntail.jar</argument>
<argument>-s</argument>
<argument>${project.build.directory}${file.separator}project-defaults.yml</argument>
<argument>-Sdev</argument>
<argument>-Dconfigsource.yaml.pollForChanges=true</argument>
<!-- <argument>-Dconfigsource.yaml.notifyOnChanges=false</argument>-->
<argument>-Dconfigsource.yaml.url=${config.yaml}</argument>
<argument>-Dconfigsource.json.url=${config.json}</argument>
<argument>-Dconfigsource.xml.url=${config.xml}</argument>
<argument>-Dconfigsource.properties.url=${config.properties}</argument>
</arguments>
</configuration>
</execution>
</executions>

</plugin>

</plugins>
</build>

</profile>

<!-- Run Payara -->
<profile>
<id>payara</id>
Expand All @@ -217,8 +112,8 @@

<properties>
<!-- payara-micro properties -->
<payara-micro.maven.version>1.0.2</payara-micro.maven.version>
<payara-micro.version>5.184</payara-micro.version>
<payara-micro.maven.version>1.4.0</payara-micro.maven.version>
<payara-micro.version>6.2023.2</payara-micro.version>
<payara-micro.installDir>${java.io.tmpdir}${file.separator}${project.artifactId}${file.separator}payara-micro</payara-micro.installDir>
<payara-micro.configDir>${basedir}${file.separator}src${file.separator}main${file.separator}payara-micro${file.separator}config</payara-micro.configDir>
<payara-micro.logsDir>${payara-micro.installDir}${file.separator}logs</payara-micro.logsDir>
Expand Down Expand Up @@ -332,13 +227,13 @@
<properties>
<log.name>org.microprofileext.config</log.name>
<log.level>FINEST</log.level>
<openliberty.version>18.0.0.4</openliberty.version>
<openliberty.version>22.0.0.13</openliberty.version>
<openliberty.http.port>8080</openliberty.http.port>
<openliberty.https.port>8443</openliberty.https.port>
<openliberty.installDir>${java.io.tmpdir}${file.separator}${project.artifactId}${file.separator}openliberty</openliberty.installDir>
<openliberty.configDir>${basedir}${file.separator}src${file.separator}main${file.separator}openliberty${file.separator}config</openliberty.configDir>
<openliberty.logsDir>${openliberty.installDir}${file.separator}wlp${file.separator}usr${file.separator}servers${file.separator}defaultServer${file.separator}logs</openliberty.logsDir>
<openliberty.maven.version>2.6</openliberty.maven.version>
<openliberty.maven.version>2.7</openliberty.maven.version>
</properties>

<build>
Expand All @@ -347,7 +242,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<version>3.4.0</version>
<executions>
<execution>
<id>add-resource</id>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.microprofileext.config.example;

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;
import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition;
import org.eclipse.microprofile.openapi.annotations.info.Contact;
import org.eclipse.microprofile.openapi.annotations.info.Info;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.EventMetadata;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.event.Observes;
import jakarta.enterprise.inject.spi.EventMetadata;
import org.microprofileext.config.event.ChangeEvent;
import org.microprofileext.config.event.Type;
import org.microprofileext.config.event.KeyFilter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package org.microprofileext.config.example;

import java.util.logging.Logger;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Provider;
import javax.json.Json;
import javax.json.JsonArrayBuilder;
import javax.ws.rs.Consumes;
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;
import javax.ws.rs.core.Response;
import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Inject;
import jakarta.inject.Provider;
import jakarta.json.Json;
import jakarta.json.JsonArrayBuilder;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.eclipse.microprofile.config.spi.ConfigSource;
Expand Down
2 changes: 1 addition & 1 deletion config-example/src/main/openliberty/config/server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!-- Enable features -->
<featureManager>
<feature>microProfile-1.4</feature>
<feature>microProfile-5.0</feature>
</featureManager>

<httpEndpoint id="defaultHttpEndpoint"
Expand Down
7 changes: 3 additions & 4 deletions config-example/src/main/webapp/WEB-INF/beans.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_3_0.xsd"
bean-discovery-mode="all">

</beans>
</beans>
2 changes: 1 addition & 1 deletion configconverter-json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.microprofile-ext</groupId>
<artifactId>config-ext</artifactId>
<version>2.0.2-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<groupId>org.microprofile-ext.config-ext</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.microprofileext.config.converter.json;

import java.io.StringReader;
import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonReader;
import jakarta.json.Json;
import jakarta.json.JsonArray;
import jakarta.json.JsonReader;
import org.eclipse.microprofile.config.spi.Converter;

/**
Expand All @@ -22,7 +22,7 @@ public JsonArray convert(String input) throws IllegalArgumentException {
}

/**
* Not to sure about this, got an javax.json.stream.JsonParsingException in Wildfly with a value of org.eclipse.microprofile.config.configproperty.unconfigureddvalue
* Not to sure about this, got an jakarta.json.stream.JsonParsingException in Wildfly with a value of org.eclipse.microprofile.config.configproperty.unconfigureddvalue
**/
private boolean isNullOrEmpty(String input){
return input==null || input.isEmpty() || input.equals(UNCONFIGURED_VALUE);
Expand Down
Loading

0 comments on commit 1b6b1ed

Please sign in to comment.