Skip to content

Commit

Permalink
Add warning that generate features modifies the source directory
Browse files Browse the repository at this point in the history
Signed-off-by: Kathryn Kodama <kathryn.s.kodama@gmail.com>
  • Loading branch information
kathrynkodama committed Jun 13, 2022
1 parent 9535882 commit d0598b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ The Liberty Maven Plugin provides the following goals.
| [devc](docs/dev.md#devc-container-mode) | Start a Liberty server in dev mode in a container. |
| [display-url](docs/display-url.md#display-url) | Display the application URL in the default browser. |
| [dump](docs/dump.md#dump) | Dump diagnostic information from the server into an archive. |
| [generate-features](docs/generate-features.md#generate-feature) | Scan the class files of an application and create a Liberty configuration file containing the Liberty features the application requires. |
| [generate-features](docs/generate-features.md#generate-feature) | Scan the class files of an application and create a Liberty configuration file in the source configuration directory containing the Liberty features the application requires. |
| [install-feature](docs/install-feature.md#install-feature) | Install a feature packaged as a Subsystem Archive (esa) to the Liberty runtime. |
| [install-server](docs/install-server.md#install-server) | Installs the Liberty runtime. This goal is implicitly invoked by all the other plugin goals and usually does not need to be executed explicitly. |
| [java-dump](docs/java-dump.md#java-dump) | Dump diagnostic information from the server JVM. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import org.twdata.maven.mojoexecutor.MojoExecutor.Element;

import io.openliberty.tools.ant.ServerTask;
import io.openliberty.tools.common.plugins.util.BinaryScannerUtil;
import io.openliberty.tools.common.plugins.util.DevUtil;
import io.openliberty.tools.common.plugins.util.InstallFeatureUtil;
import io.openliberty.tools.common.plugins.util.JavaCompilerOptions;
Expand Down Expand Up @@ -1279,6 +1280,17 @@ protected void doExecute() throws Exception {
// generate features on startup - provide all classes and only user specified
// features to binary scanner
try {
String generatedFileCanonicalPath;
try {
generatedFileCanonicalPath = new File(configDirectory,
BinaryScannerUtil.GENERATED_FEATURES_FILE_PATH).getCanonicalPath();
} catch (IOException e) {
generatedFileCanonicalPath = new File(configDirectory,
BinaryScannerUtil.GENERATED_FEATURES_FILE_PATH).toString();
}
log.warn(
"The source configuration directory will be modified. Features will automatically be generated in a new file: "
+ generatedFileCanonicalPath);
runLibertyMojoGenerateFeatures(null, true);
} catch (MojoExecutionException e) {
if (e.getCause() != null && e.getCause() instanceof PluginExecutionException) {
Expand Down

0 comments on commit d0598b9

Please sign in to comment.