From 02fcb785f17c1c639b4d93a87a5508cdf3747375 Mon Sep 17 00:00:00 2001 From: Sergei Ivanov Date: Sat, 13 Oct 2018 08:57:20 +0100 Subject: [PATCH] Eclipse-related documentation and metadata updates (#37) * Added the default m2e lifecycle mapping * Updated README to include additional workarounds for Eclipse --- README.md | 37 +++++++++++++++++++ .../m2e/lifecycle-mapping-metadata.xml | 19 ++++++++++ 2 files changed, 56 insertions(+) create mode 100644 src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml diff --git a/README.md b/README.md index b846e1c..e26e67a 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,43 @@ If you are using Eclipse, you need to install an additional Eclipse plugin becau (As you might have noticed, `os-maven-plugin` is a Maven extension, a Maven plugin, and an Eclipse plugin.) +Alternatively, in some projects it may be possible to add the plugin to the build lifecycle instead of using it as an extension. Remove the plugin from the `` section of the POM and place it into the `` section instead: + +```xml + + kr.motd.maven + os-maven-plugin + 1.6.0 + + + initialize + + detect + + + + +``` + If you are using other IDEs such as NetBeans, you need to set the system properties `os-maven-plugin` sets manually when your IDE is launched. You usually use JVM's `-D` flags like the following: -Dos.detected.name=linux -Dos.detected.arch=x86_64 -Dos.detected.classifier=linux-x86_64 + +Alternatively, you can hardcode the properties in the local Maven settings. Add the following sections to `settings.xml` (specify property values according to your OS configuration): + +```xml + + + os-properties + + linux + x86_64 + linux-x86_64 + + + + + + os-properties + +``` diff --git a/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml b/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml new file mode 100644 index 0000000..4fa3436 --- /dev/null +++ b/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml @@ -0,0 +1,19 @@ + + + + + + + + detect + + + + + true + true + + + + +