From 6c0a3024ca2cb56ac5e1fc7f41b66a0c4cea78dd Mon Sep 17 00:00:00 2001 From: lajos papp Date: Thu, 14 Jun 2012 02:53:21 +0200 Subject: [PATCH] adding ReadMe.md to describe maven usage, configuring exec:java plugin to execute the main 'namespace' --- examples/maven/hello-world/ReadMe.md | 30 ++++++++++++++++++++++++++++ examples/maven/hello-world/pom.xml | 16 +++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 examples/maven/hello-world/ReadMe.md diff --git a/examples/maven/hello-world/ReadMe.md b/examples/maven/hello-world/ReadMe.md new file mode 100644 index 00000000000..550d5b946f4 --- /dev/null +++ b/examples/maven/hello-world/ReadMe.md @@ -0,0 +1,30 @@ +# Kotlin hello-world example with maven + +## Prerequisites to running the example + + * download Maven directly from the [Apache Maven homepage](http://maven.apache.org/download.html) + * install and configure your system as described in [the installation section](http://maven.apache.org/download.html#Installation) + +## Compiling/Testing/Running the example + +If you have maven on your path, simple type: + + mvn test + +It will compile: + * src/main/kotlin/Hello.kt into target/classes/hello/namespace.class + * src/main/kotlin/Hello.kt into target/test-classes/hello/tests/HelloTest.class + +Then run tests, and finnaly run your man hello 'namespace'. + +## Only running the example + +Once you compiled the sources with previous 'mvn test' command, you can run the application by typing: + + mvn exec:java + +## Using commandline arguments + +If you want to modify the main method in Hello.kt in order to use commandline arguments, you can specify them on commandline as: + + mvn exec:java -Dexec.args="argument1" diff --git a/examples/maven/hello-world/pom.xml b/examples/maven/hello-world/pom.xml index c789a0f2846..3d52d2af70e 100644 --- a/examples/maven/hello-world/pom.xml +++ b/examples/maven/hello-world/pom.xml @@ -59,6 +59,22 @@ + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + test + + java + + + + + hello.namespace + +