forked from emmartins/wildfly-server-migration
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CMTOOL-363] WildFly 32 server module
- Loading branch information
Showing
11 changed files
with
346 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
51 changes: 51 additions & 0 deletions
51
servers/wildfly32.0/src/main/java/org/jboss/migration/wfly/WildFly32_0Server.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...ildfly32.0/src/main/java/org/jboss/migration/wfly/WildFly32_0ServerMigrationProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | ||
} |
70 changes: 70 additions & 0 deletions
70
servers/wildfly32.0/src/main/java/org/jboss/migration/wfly/WildFly32_0ServerProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} | ||
} |
116 changes: 116 additions & 0 deletions
116
...0/src/main/java/org/jboss/migration/wfly/task/hostexclude/WildFly32_0AddHostExcludes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
Oops, something went wrong.