Skip to content

Commit

Permalink
rolling back workflow changes
Browse files Browse the repository at this point in the history
Signed-off-by: Arun Venmany <[email protected]>
  • Loading branch information
arunvenmany-ibm committed Jan 15, 2025
1 parent c1fc05a commit 23c34e6
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
run: ./mvnw -V verify --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -Ponline-its -D"invoker.streamLogsOnFailures"=true -D"invoker.test"="*setup*,*springboot-3-*,*compile-jsp-source-17-*" -Druntime=${{ matrix.RUNTIME }} -DruntimeVersion="${{ matrix.RUNTIME_VERSION }}"
# Run tests
- name: Run tests
run: ./mvnw -V verify --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -Ponline-its -D"invoker.streamLogsOnFailures"=true -D"invoker.test"="*dev-it*" -Druntime=${{ matrix.RUNTIME }} -DruntimeVersion="${{ matrix.RUNTIME_VERSION }}"
run: ./mvnw -V verify --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -Ponline-its -D"invoker.streamLogsOnFailures"=true -Druntime=${{ matrix.RUNTIME }} -DruntimeVersion="${{ matrix.RUNTIME_VERSION }}"

# WINDOWS BUILD
build-windows:
Expand Down
4 changes: 1 addition & 3 deletions liberty-maven-plugin/src/it/dev-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@
<argLine>-enableassertions</argLine>
<workingDirectory>${project.build.directory}</workingDirectory>
<includes>
<include>**/*DevRecompileWithCustomExecutionIdTest.java</include>
<include>**/*DevRecompileWithDefaultExecutionIdTest.java</include>
<include>**/*DevTest.java</include>
<include>**/*Test.java</include>
</includes>
<systemPropertyVariables>
<mavenPluginVersion>@pom.version@</mavenPluginVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>

<groupId>dev-it-tests</groupId>
<artifactId>dev-sample-proj</artifactId>
<artifactId>basic-dev-project-with-default-execution-id</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>

<groupId>dev-it-tests</groupId>
<artifactId>dev-sample-proj</artifactId>
<artifactId>basic-dev-project-with-execution-id</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,58 +151,6 @@ protected static void setUpBeforeClass(String params, String projectRoot, boolea
}
}

/**
* Setup and optionally start dev/run
*
* @param params Params for the dev/run goal
* @param projectRoot The Maven project root
* @param isDevMode Use dev if true, use run if false. Ignored if startProcessDuringSetup is false.
* @param startProcessDuringSetup If this method should start the actual dev/run process
* @param libertyConfigModule For multi module project, the module where Liberty configuration is located
* @param pomModule For multi module project, the module where the pom is located. If null, use the project root.
* @throws IOException
* @throws InterruptedException
* @throws FileNotFoundException
*/
protected static void setUpBeforeClassWithoutTemp(String params, String projectRoot, boolean isDevMode, boolean startProcessDuringSetup, String libertyConfigModule, String pomModule) throws IOException, InterruptedException, FileNotFoundException {
customLibertyModule = libertyConfigModule;
customPomModule = pomModule;

basicDevProj = new File(projectRoot);

tempProj = basicDevProj;
assertTrue("temp directory does not exist", tempProj.exists());

assertTrue(projectRoot+" directory does not exist", basicDevProj.exists());

assertTrue("temp directory does not contain expected copied files from "+projectRoot, tempProj.listFiles().length > 0);

// in case cleanup was not successful, try to delete the various log files so we can proceed
logFile = new File(basicDevProj, "logFile.txt");
if (logFile.exists()) {
assertTrue("Could not delete log file: "+logFile.getCanonicalPath(), logFile.delete());
}
assertTrue("log file already existed: "+logFile.getCanonicalPath(), logFile.createNewFile());
logErrorFile = new File(basicDevProj, "logErrorFile.txt");
if (logErrorFile.exists()) {
assertTrue("Could not delete logError file: "+logErrorFile.getCanonicalPath(), logErrorFile.delete());
}
assertTrue("logError file already existed: "+logErrorFile.getCanonicalPath(), logErrorFile.createNewFile());

if (customPomModule == null) {
pom = new File(tempProj, "pom.xml");
} else {
pom = new File(new File(tempProj, customPomModule), "pom.xml");
}
assertTrue(pom.getCanonicalPath()+" file does not exist", pom.exists());

replaceVersion();

if (startProcessDuringSetup) {
startProcess(params, isDevMode);
}
}

protected static void startProcess(String params, boolean isDevMode) throws IOException, InterruptedException, FileNotFoundException {
startProcess(params, isDevMode, "mvn liberty:");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class DevRecompileWithCustomExecutionIdTest extends BaseDevTest {

@BeforeClass
public static void setUpBeforeClass() throws Exception {
setUpBeforeClassWithoutTemp(null, "../resources/basic-dev-project-with-execution-id", true, false, null, null);
setUpBeforeClass(null, "../resources/basic-dev-project-with-execution-id", true, false, null, null);
startProcess(null, true, "mvn compile liberty:", true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class DevRecompileWithDefaultExecutionIdTest extends BaseDevTest {

@BeforeClass
public static void setUpBeforeClass() throws Exception {
setUpBeforeClassWithoutTemp(null, "../resources/basic-dev-project-with-default-execution-id", true, false, null, null);
setUpBeforeClass(null, "../resources/basic-dev-project-with-default-execution-id", true, false, null, null);
startProcess(null, true, "mvn compile liberty:", true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginExecution;
Expand Down Expand Up @@ -269,8 +271,9 @@ public static Xpp3Dom getPluginGoalConfig(Plugin plugin, String goal, Log log) {
String execId = "default";
int numExec = 0;

List<PluginExecution> executions = plugin.getExecutions();
if (executions != null) {
List<PluginExecution> executions = plugin.getExecutions()
.stream().sorted(Comparator.comparing(PluginExecution::getPriority)).collect(Collectors.toList());
if (!executions.isEmpty()) {
for (PluginExecution e : executions) {
if (e.getGoals() != null && e.getGoals().contains(goal)) {
if (numExec == 0) {
Expand All @@ -289,10 +292,10 @@ public static Xpp3Dom getPluginGoalConfig(Plugin plugin, String goal, Log log) {
config = (Xpp3Dom) plugin.getConfiguration();
}
if (numExec > 1) {
log.warn(plugin.getArtifactId() + ":" + goal
log.warn(plugin.getArtifactId() + ":" + goal
+ " goal has multiple execution configurations (default to \"" + execId + "\" execution)");
}

if (config == null) {
config = configuration();
} else {
Expand Down

0 comments on commit 23c34e6

Please sign in to comment.