Skip to content

Commit

Permalink
Merge pull request #441 from jfdenise/bootable_jar_with_galleon_api_v2
Browse files Browse the repository at this point in the history
Add support for bootable JAR
  • Loading branch information
jamezp authored Dec 13, 2023
2 parents 34213bc + dbb6b12 commit e853bab
Show file tree
Hide file tree
Showing 31 changed files with 3,551 additions and 18 deletions.
32 changes: 32 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
<version.org.jboss.shrinkwrap.shrinkwrap>1.2.6</version.org.jboss.shrinkwrap.shrinkwrap>

<jboss.home>${project.build.directory}${file.separator}wildfly</jboss.home>
<test.class.path>${project.build.testOutputDirectory}</test.class.path>
<test.jvm.args>-Dmaven.repo.local=${settings.localRepository}</test.jvm.args>
</properties>

<licenses>
Expand Down Expand Up @@ -92,6 +94,19 @@
</dependencies>

<build>
<testResources>
<!-- Process default resources -->
<testResource>
<directory>src/test/resources</directory>
<targetPath>${project.build.testOutputDirectory}</targetPath>
</testResource>
<!-- Copy the custom modules to the WildFly module directory -->
<testResource>
<directory>src/test/modules</directory>
<filtering>true</filtering>
<targetPath>${jboss.home}/modules</targetPath>
</testResource>
</testResources>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
Expand Down Expand Up @@ -119,6 +134,7 @@
<location>wildfly@maven(org.jboss.universe:community-universe)#${version.org.wildfly}</location>
</feature-pack>
</feature-packs>
<record-state>false</record-state>
<install-dir>${project.build.directory}/wildfly</install-dir>
<plugin-options>
<jboss-fork-embedded>${plugin.fork.embedded}</jboss-fork-embedded>
Expand All @@ -127,6 +143,21 @@
</execution>
</executions>
</plugin>
<!-- We need to bind a new execution of this to run after provisioning is done so the module.xml file
required for testing is not deleted.
-->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-module</id>
<phase>pre-integration-test</phase>
<goals>
<goal>testResources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
Expand All @@ -141,6 +172,7 @@
<redirectTestOutputToFile>${maven.test.redirectTestOutputToFile}</redirectTestOutputToFile>
<systemPropertyVariables>
<jboss.home>${jboss.home}</jboss.home>
<test.jvm.args>${test.jvm.args}</test.jvm.args>
</systemPropertyVariables>
</configuration>
<executions>
Expand Down
25 changes: 25 additions & 0 deletions core/src/main/java/org/wildfly/plugin/core/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,42 @@

import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
*
* @author [email protected]
*/
public class Utils {
private static final Pattern WHITESPACE_IF_NOT_QUOTED = Pattern.compile("(\\S+\"[^\"]+\")|\\S+");

public static boolean isValidHomeDirectory(final Path path) {
return path != null
&& Files.exists(path)
&& Files.isDirectory(path)
&& Files.exists(path.resolve("jboss-modules.jar"));
}

/**
* Splits the arguments into a list. The arguments are split based on
* whitespace while ignoring whitespace that is within quotes.
*
* @param arguments the arguments to split
*
* @return the list of the arguments
*/
public static List<String> splitArguments(final CharSequence arguments) {
final List<String> args = new ArrayList<>();
final Matcher m = WHITESPACE_IF_NOT_QUOTED.matcher(arguments);
while (m.find()) {
final String value = m.group();
if (!value.isEmpty()) {
args.add(value);
}
}
return args;
}
}
Loading

0 comments on commit e853bab

Please sign in to comment.