Skip to content

Commit

Permalink
Remove legacy patching
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdenise committed Dec 12, 2023
1 parent 888a849 commit d8f1db5
Show file tree
Hide file tree
Showing 16 changed files with 0 additions and 1,685 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,36 +165,6 @@ public static ScannedArtifacts scanArtifacts(ProvisioningManager pm, Provisionin
cliArtifacts.add(a);
continue;
}
if ("wildfly-patching".equals(a.getArtifactId())
&& "org.wildfly.core".equals(a.getGroupId())) {
// We got it.
log.debug(fprt.getFPID(), a);
cliArtifacts.add(a);
continue;
}
// All the following ones are patching required dependencies:
if ("wildfly-controller".equals(a.getArtifactId())
&& "org.wildfly.core".equals(a.getGroupId())) {
// We got it.
log.debug(fprt.getFPID(), a);
cliArtifacts.add(a);
continue;
}
if ("wildfly-version".equals(a.getArtifactId())
&& "org.wildfly.core".equals(a.getGroupId())) {
// We got it.
log.debug(fprt.getFPID(), a);
cliArtifacts.add(a);
continue;
}
if ("vdx-core".equals(a.getArtifactId())
&& "org.projectodd.vdx".equals(a.getGroupId())) {
// We got it.
log.debug(fprt.getFPID(), a);
cliArtifacts.add(a);
continue;
}
// End patching dependencies.
if (JBOSS_MODULES_ARTIFACT_ID.equals(a.getArtifactId())
&& JBOSS_MODULES_GROUP_ID.equals(a.getGroupId())) {
jbossModules = a;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
import org.wildfly.plugins.bootablejar.maven.cli.LocalCLIExecutor;
import org.wildfly.plugins.bootablejar.maven.cli.RemoteCLIExecutor;
import org.wildfly.plugins.bootablejar.maven.common.FeaturePack;
import org.wildfly.plugins.bootablejar.maven.common.LegacyPatchCleaner;
import org.wildfly.plugins.bootablejar.maven.common.MavenRepositoriesEnricher;
import org.wildfly.plugins.bootablejar.maven.common.OverriddenArtifact;
import org.wildfly.plugins.bootablejar.maven.common.Utils;
Expand Down Expand Up @@ -277,32 +276,6 @@ public abstract class AbstractBuildBootableJarMojo extends AbstractMojo {
@Parameter(alias = "provisioning-file", property = "wildfly.bootable.provisioning.file", defaultValue = "${project.basedir}/galleon/provisioning.xml")
private File provisioningFile;

/**
* Deprecated. Path to a CLI script that applies legacy patches. Content of such script
* should be composed of 'patch apply [path to zip file] [patch apply
* options]' commands. Due to the nature of a bootable JAR trimmed with
* Galleon, part of the content of the patch can be missing. In order to
* force the patch to apply use the '--override-all' option. The
* '--distribution' option is not needed, System property 'jboss.home.dir'
* is automatically set to the server that will be packaged in the bootable
* JAR. If the script file is not absolute, it has to be relative to the
* project base directory.
* NB: The server is patched with a legacy patch right after the server
* has been provisioned with Galleon.
*/
@Deprecated
@Parameter(alias = "legacy-patch-cli-script")
String legacyPatchCliScript;

/**
* Deprecated. Set to true to enable patch cleanup. When cleanup is enabled, unused
* added modules, patched modules original directories, unused overlay
* directories and .installation/patches directory are deleted.
*/
@Deprecated
@Parameter(alias = "legacy-patch-clean-up", defaultValue = "false")
boolean legacyPatchCleanUp;

/**
* By default executed CLI scripts output is not shown if execution is
* successful. In order to display the CLI output, set this option to true.
Expand Down Expand Up @@ -473,8 +446,6 @@ public void execute() throws MojoExecutionException, MojoFailureException {
getLog().info("CLI executions are done in forked process");
}

// Legacy Patching point
legacyPatching();
copyExtraContentInternal(wildflyDir, contentDir);
copyExtraContent(wildflyDir);
List<String> commands = new ArrayList<>();
Expand Down Expand Up @@ -564,37 +535,6 @@ private void restoreLoggingFile(Path originalLoggingFile) throws IOException {
}
}

private void legacyPatching() throws Exception {
if (legacyPatchCliScript != null) {
LegacyPatchCleaner patchCleaner = null;
if (legacyPatchCleanUp) {
patchCleaner = new LegacyPatchCleaner(wildflyDir, getLog());
}
String prop = "jboss.home.dir";
System.setProperty(prop, wildflyDir.toAbsolutePath().toString());
try {
Path patchScript = resolvePath(Paths.get(legacyPatchCliScript));
if (Files.notExists(patchScript)) {
throw new Exception("Patch CLI script " + patchScript + " doesn't exist");
}
List<CliSession> cliPatchingSessions = new ArrayList<>();
List<String> files = new ArrayList<>();
files.add(patchScript.toString());
CliSession patchingSession = new CliSession();
patchingSession.setResolveExpressions(true);
patchingSession.setScriptFiles(files);
cliPatchingSessions.add(patchingSession);
getLog().info("Patching server with " + patchScript + " CLI script.");
userScripts(wildflyDir, cliPatchingSessions, false);
if (patchCleaner != null) {
patchCleaner.clean();
}
} finally {
System.clearProperty(prop);
}
}
}

private void copyExtraContent(Path wildflyDir) throws Exception {
for (String path : extraServerContentDirs) {
Path extraContent = Paths.get(path);
Expand Down
30 changes: 0 additions & 30 deletions tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,35 +124,6 @@

<build>
<plugins>
<!-- provision a full server to be used as patching distribution source -->

<plugin>
<groupId>org.jboss.galleon</groupId>
<artifactId>galleon-maven-plugin</artifactId>
<executions>
<execution>
<id>server-provisioning-for-patching</id>
<goals>
<goal>provision</goal>
</goals>
<phase>process-test-resources</phase>
<configuration>
<install-dir>${jbossas.dist}</install-dir>
<record-state>false</record-state>
<plugin-options>
<jboss-fork-embedded>true</jboss-fork-embedded>
</plugin-options>
<feature-packs>
<feature-pack>
<groupId>${wildfly.groupId}</groupId>
<artifactId>${wildfly.artifactId}</artifactId>
<version>${version.wildfly}</version>
</feature-pack>
</feature-packs>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand All @@ -170,7 +141,6 @@
<test.version.wildfly-ee.upgrade>${test.version.wildfly-ee.upgrade}</test.version.wildfly-ee.upgrade>
<test.version.wildfly>${test.version.wildfly}</test.version.wildfly>
<test.plugin.version>${project.version}</test.plugin.version>
<test.patch.version>${test.patch.version}</test.patch.version>
<jbossas.dist>${jbossas.dist}</jbossas.dist>
<test.groupid.wildfly>${wildfly.groupId}</test.groupid.wildfly>
<!-- DevWatch* tests run maven and need to use the same repository -->
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit d8f1db5

Please sign in to comment.