Skip to content

Commit

Permalink
[CMTOOL-363] WildFly 32 server module
Browse files Browse the repository at this point in the history
  • Loading branch information
emmartins committed May 2, 2024
1 parent dbf7837 commit 718afef
Show file tree
Hide file tree
Showing 11 changed files with 346 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public interface JBossExtensionNames {
String EE_SECURITY = "org.wildfly.extension.ee-security";
String EJB3 = "org.jboss.as.ejb3";
String ELYTRON = "org.wildfly.extension.elytron";
String ELYTRON_JAAS_REALM = "org.wildfly.extension.elytron.jaas-realm";
String ELYTRON_OIDC_CLIENT = "org.wildfly.extension.elytron-oidc-client";
String HEALTH = "org.wildfly.extension.health";
String IIOP_OPENJDK = "org.wildfly.iiop-openjdk";
Expand Down Expand Up @@ -71,6 +72,7 @@ public interface JBossExtensionNames {
String MICROPROFILE_REACTIVE_STREAMS_OPERATORS_SMALLRYE = "org.wildfly.extension.microprofile.reactive-streams-operators-smallrye";
String MICROPROFILE_TELEMETRY = "org.wildfly.extension.microprofile.telemetry";
String MODCLUSTER = "org.jboss.as.modcluster";
String MVC_KRAZO = "org.wildfly.extension.mvc-krazo";
String NAMING = "org.jboss.as.naming";
String OPENTELEMETRY = "org.wildfly.extension.opentelemetry";
String OSGI = "org.jboss.as.osgi";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ public interface JBossExtensions {
.subsystem(Subsystem.builder().name(JBossSubsystemNames.ELYTRON).namespaceWithoutVersion("urn:wildfly:"+JBossSubsystemNames.ELYTRON))
.build();

Extension ELYTRON_JAAS_REALM = Extension.builder()
.module(JBossExtensionNames.ELYTRON_JAAS_REALM)
.build();

Extension ELYTRON_OIDC_CLIENT = Extension.builder()
.module(JBossExtensionNames.ELYTRON_OIDC_CLIENT)
.subsystem(Subsystem.builder().name(JBossSubsystemNames.ELYTRON_OIDC_CLIENT).namespaceWithoutVersion("urn:wildfly:"+JBossSubsystemNames.ELYTRON_OIDC_CLIENT))
Expand Down Expand Up @@ -273,6 +277,11 @@ public interface JBossExtensions {
.subsystem(JBossSubsystemNames.MODCLUSTER)
.build();

Extension MVC_KRAZO = Extension.builder()
.module(JBossExtensionNames.MVC_KRAZO)
.subsystem(JBossSubsystemNames.MVC_KRAZO)
.build();

Extension NAMING = Extension.builder()
.module(JBossExtensionNames.NAMING)
.subsystem(JBossSubsystemNames.NAMING)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public interface JBossSubsystemNames {
String MICROPROFILE_TELEMETRY = "microprofile-telemetry";

String MODCLUSTER = "modcluster";
String MVC_KRAZO = "mvc-krazo";
String NAMING = "naming";
String OPENTELEMETRY = "opentelemetry";
String OSGI = "osgi";
Expand Down
6 changes: 6 additions & 0 deletions dist/standalone/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,12 @@
<artifactId>jboss-server-migration-wildfly31.0-to-wildfly31.0</artifactId>
</dependency>

<!-- wfly 32.0 -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jboss-server-migration-wildfly32.0-server</artifactId>
</dependency>

<!-- EXTERNAL DEPENDENCIES -->

<dependency>
Expand Down
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
<module>servers/wildfly29.0</module>
<module>servers/wildfly30.0</module>
<module>servers/wildfly31.0</module>
<module>servers/wildfly32.0</module>
</modules>

<build>
Expand Down Expand Up @@ -983,6 +984,13 @@
<version>${project.version}</version>
</dependency>

<!-- wfly 32.0 -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jboss-server-migration-wildfly32.0-server</artifactId>
<version>${project.version}</version>
</dependency>

<!-- External Dependencies -->

<dependency>
Expand Down
41 changes: 41 additions & 0 deletions servers/wildfly32.0/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2024 Red Hat, Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<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>

<parent>
<groupId>org.jboss.migration</groupId>
<artifactId>jboss-server-migration-parent</artifactId>
<version>32.0.0.Final-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>jboss-server-migration-wildfly32.0-server</artifactId>

<name>JBoss Server Migration: WildFly 32.0 Server</name>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jboss-server-migration-wildfly31.0-server</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright 2024 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.migration.wfly;

import org.jboss.migration.core.ProductInfo;
import org.jboss.migration.core.env.MigrationEnvironment;
import org.jboss.migration.core.jboss.JBossExtensions;
import org.jboss.migration.core.jboss.JBossServer;
import org.jboss.migration.wfly10.ServiceLoaderWildFlyServerMigrations10;
import org.jboss.migration.wfly10.WildFlyServer10;
import org.jboss.migration.wfly10.WildFlyServerMigrations10;

import java.nio.file.Path;
import java.util.ServiceLoader;

/**
* The WildFly 32.0 {@link org.jboss.migration.core.Server}.
* @author emmartins
*/
public class WildFly32_0Server extends WildFlyServer10 {

public static final JBossServer.Extensions EXTENSIONS = JBossServer.Extensions.builder()
.extensions(WildFly31_0Server.EXTENSIONS)
.extension(JBossExtensions.ELYTRON_JAAS_REALM)
.extension(JBossExtensions.MVC_KRAZO)
.build();

private static final WildFlyServerMigrations10 SERVER_MIGRATIONS = new ServiceLoaderWildFlyServerMigrations10<>(ServiceLoader.load(WildFly32_0ServerMigrationProvider.class));

public WildFly32_0Server(String migrationName, ProductInfo productInfo, Path baseDir, MigrationEnvironment migrationEnvironment) {
super(migrationName, productInfo, baseDir, migrationEnvironment, EXTENSIONS);
}

@Override
protected WildFlyServerMigrations10 getMigrations() {
return SERVER_MIGRATIONS;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2024 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.jboss.migration.wfly;

import org.jboss.migration.wfly10.WildFlyServerMigrationProvider10;

/**
* The interface that WildFly 32.0 specific migration providers must implement. Such implementations are loaded through ServiceLoader framework, thus a service descriptor must be in classpath.
* @author emmartins
*/
public interface WildFly32_0ServerMigrationProvider extends WildFlyServerMigrationProvider10 {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright 2024 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.migration.wfly;

import org.jboss.migration.core.ProductInfo;
import org.jboss.migration.core.Server;
import org.jboss.migration.core.ServerMigrationFailureException;
import org.jboss.migration.core.env.MigrationEnvironment;
import org.jboss.migration.core.jboss.JBossServer;
import org.jboss.migration.core.jboss.ManifestProductInfo;
import org.jboss.migration.wfly10.dist.full.WildFlyFullServerProvider10_0;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.jar.JarInputStream;

/**
* The WildFly 32.x {@link org.jboss.migration.core.ServerProvider}.
* @author emmartins
*/
public class WildFly32_0ServerProvider extends WildFlyFullServerProvider10_0 {

@Override
protected ProductInfo getProductInfo(Path baseDir, MigrationEnvironment migrationEnvironment) throws IllegalArgumentException {
final JBossServer.Module module = new JBossServer.Modules(baseDir).getModule("org.jboss.as.product:main");
if (module == null) {
return null;
}
try {
Path moduleJar = Files.list(module.getModuleDir()).filter(path -> path.toString().endsWith(".jar")).findFirst().get();
if (moduleJar == null || !Files.isRegularFile(moduleJar)) {
return null;
}
try (JarInputStream jarStream = new JarInputStream(Files.newInputStream(moduleJar))) {
return ManifestProductInfo.from(jarStream.getManifest());
}
} catch (IOException e) {
throw new ServerMigrationFailureException(e);
}
}

@Override
protected String getProductVersionRegex() {
return "32\\..*";
}

@Override
protected Server constructServer(String migrationName, ProductInfo productInfo, Path baseDir, MigrationEnvironment migrationEnvironment) {
return new WildFly32_0Server(migrationName, productInfo, baseDir, migrationEnvironment);
}

@Override
public String getName() {
return "WildFly 32.x";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/*
* Copyright 2024 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.migration.wfly.task.hostexclude;

import org.jboss.migration.core.jboss.HostExclude;
import org.jboss.migration.core.jboss.HostExcludes;
import org.jboss.migration.core.jboss.JBossExtensionNames;
import org.jboss.migration.wfly10.config.task.hostexclude.AddHostExcludes;

/**
* @author emmartins
*/
public class WildFly32_0AddHostExcludes<S> extends AddHostExcludes<S> {

private static final HostExcludes HOST_EXCLUDES = HostExcludes.builder()
.hostExclude(HostExclude.builder()
.name("WildFly23.0")
.release("WildFly23.0")
.excludedExtension(JBossExtensionNames.CLUSTERING_EJB)
.excludedExtension(JBossExtensionNames.ELYTRON_OIDC_CLIENT)
.excludedExtension(JBossExtensionNames.OPENTELEMETRY)
.excludedExtension(JBossExtensionNames.MICROMETER)
.excludedExtension(JBossExtensionNames.MICROPROFILE_LRA_PARTICIPANT)
.excludedExtension(JBossExtensionNames.MICROPROFILE_LRA_COORDINATOR)
.excludedExtension(JBossExtensionNames.MICROPROFILE_TELEMETRY)
.excludedExtension(JBossExtensionNames.ELYTRON_JAAS_REALM)
.excludedExtension(JBossExtensionNames.MVC_KRAZO)
)
.hostExclude(HostExclude.builder()
.name("WildFly24.0")
.release("WildFly24.0")
.excludedExtension(JBossExtensionNames.CLUSTERING_EJB)
.excludedExtension(JBossExtensionNames.ELYTRON_OIDC_CLIENT)
.excludedExtension(JBossExtensionNames.OPENTELEMETRY)
.excludedExtension(JBossExtensionNames.MICROMETER)
.excludedExtension(JBossExtensionNames.MICROPROFILE_LRA_PARTICIPANT)
.excludedExtension(JBossExtensionNames.MICROPROFILE_LRA_COORDINATOR)
.excludedExtension(JBossExtensionNames.MICROPROFILE_TELEMETRY)
.excludedExtension(JBossExtensionNames.ELYTRON_JAAS_REALM)
.excludedExtension(JBossExtensionNames.MVC_KRAZO)
)
.hostExclude(HostExclude.builder()
.name("WildFly25.0")
.release("WildFly25.0")
.excludedExtension(JBossExtensionNames.CLUSTERING_EJB)
.excludedExtension(JBossExtensionNames.MICROMETER)
.excludedExtension(JBossExtensionNames.MICROPROFILE_LRA_PARTICIPANT)
.excludedExtension(JBossExtensionNames.MICROPROFILE_LRA_COORDINATOR)
.excludedExtension(JBossExtensionNames.MICROPROFILE_TELEMETRY)
.excludedExtension(JBossExtensionNames.ELYTRON_JAAS_REALM)
.excludedExtension(JBossExtensionNames.MVC_KRAZO)
)
.hostExclude(HostExclude.builder()
.name("WildFly26.0")
.release("WildFly26.0")
.excludedExtension(JBossExtensionNames.CLUSTERING_EJB)
.excludedExtension(JBossExtensionNames.MICROMETER)
.excludedExtension(JBossExtensionNames.MICROPROFILE_LRA_PARTICIPANT)
.excludedExtension(JBossExtensionNames.MICROPROFILE_LRA_COORDINATOR)
.excludedExtension(JBossExtensionNames.MICROPROFILE_TELEMETRY)
.excludedExtension(JBossExtensionNames.ELYTRON_JAAS_REALM)
.excludedExtension(JBossExtensionNames.MVC_KRAZO)
)
.hostExclude(HostExclude.builder()
.name("WildFly27.0")
.release("WildFly27.0")
.excludedExtension(JBossExtensionNames.MICROMETER)
.excludedExtension(JBossExtensionNames.MICROPROFILE_LRA_PARTICIPANT)
.excludedExtension(JBossExtensionNames.MICROPROFILE_LRA_COORDINATOR)
.excludedExtension(JBossExtensionNames.MICROPROFILE_TELEMETRY)
.excludedExtension(JBossExtensionNames.ELYTRON_JAAS_REALM)
.excludedExtension(JBossExtensionNames.MVC_KRAZO)
)
.hostExclude(HostExclude.builder()
.name("WildFly28.0")
.release("WildFly28.0")
.excludedExtension(JBossExtensionNames.ELYTRON_JAAS_REALM)
.excludedExtension(JBossExtensionNames.MVC_KRAZO)
)
.hostExclude(HostExclude.builder()
.name("WildFly29.0")
.release("WildFly29.0")
.excludedExtension(JBossExtensionNames.ELYTRON_JAAS_REALM)
.excludedExtension(JBossExtensionNames.MVC_KRAZO)
)
.hostExclude(HostExclude.builder()
.name("WildFly30.0")
.release("WildFly30.0")
.excludedExtension(JBossExtensionNames.ELYTRON_JAAS_REALM)
.excludedExtension(JBossExtensionNames.MVC_KRAZO)
)
.hostExclude(HostExclude.builder()
.name("WildFly31.0")
.release("WildFly31.0")
.excludedExtension(JBossExtensionNames.ELYTRON_JAAS_REALM)
.excludedExtension(JBossExtensionNames.MVC_KRAZO)
)
.build();

public WildFly32_0AddHostExcludes() {
super(HOST_EXCLUDES);
}
}
Loading

0 comments on commit 718afef

Please sign in to comment.