mysema/scalagen — Issue #34: maven-plugin: make targetFolder accessible via cmdline (add expression)
Author: lefou
Created: 2012-02-02 09:17:31+00:00
State: open

*Motivation:*

Currently, one has to add the plugin to the pom.xml to use the maven-scalagen-plugin. As converting code from an existing maven project is usually an one-time-task, it makes much sense to use the plugin without any need to edit the pom.xml.

To do this use the following commandline:

```
$ mvn com.mysema.scalagen:scalagen-maven-plugin:0.1.2:main
```

Unfortunatelly, you can not configure the targetFolder that way, which is especially inconvenient when you already have some scala code in your project.

*Solution:*

Add the "expression"-tag to the JavaDoc of the ```targetFolder``` field:

```Java
/**
* @parameter default-value="src/test/scala" expression="${targetFolder}"
*/
private String targetFolder;
```

Now you can run maven like this, to generate the converted code into another directory (here target/generated-for-review):

```
$ mvn com.mysema.scalagen:scalagen-maven-plugin:0.1.2:main -DtargetFolder=target/generated-for-review
```

Same applys for the test goal.

Many thanks for scalagen and the Maven plugin!

Tobias Roeser