-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Description
Source repo: https://github.com/tsmock/josm/tree/pom
Notes:
- I'm attempting to convert an ant build.xml file to maven
- I'd like to make it possible to run resource generation and misc scripts with
mvn exec:{exec|java}@id - Two of the tasks are bound to phases and work properly as such. They do not work when called manually.
- To check the output of those two tasks, look at
target/classes/data/projection/custom-epsg-- it should not be empty (and is not empty onmvn clean test-compileormvn clean package) - These tasks are bound to phases that run after
compilebut beforetest-compile
- To check the output of those two tasks, look at
- I am probably overlooking something. I'm also probably doing something stupid in the pom files.
Steps to reproduce in cloned repo:
$ git clone https://github.com/tsmock/josm.git --branch pom
$ mvn clean test-compile
$ head -n3 target/classes/data/projection/custom-epsg
$ mvn clean compile exec:exec@epsg-touch exec:exec@epsg
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.2.0:exec (epsg-touch) on project josm-parent: The parameter 'executable' is missing or invalid -> [Help 1]
$ head -n3 target/classes/data/projection/custom-epsgWhat I've looked at:
- https://stackoverflow.com/questions/8252107/is-it-possible-to-execute-two-different-maven-exec-maven-plugin-in-a-single-pom: I think I'm doing the right thing[1]
- https://stackoverflow.com/questions/2192660/maven-maven-exec-plugin-multiple-execution-configurations: I think I'm doing the right thing[1]
- Multiple execution of plugin does not workย #22 : I think I'm doing the right thing[1]
- The parameter 'executable' is missing or invalidย #287 : Not helpful.
[1] POM XML
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <!-- version used is 3.2.0, declared in parent -->
<executions>
<!-- mvn test-compile && mvn exec:java@update-proj-reference-files -->
<execution>
<id>update-proj-reference-files</id>
<configuration>
<classpathScope>test</classpathScope>
<mainClass>org.openstreetmap.josm.data.projection.ProjectionRefTest</mainClass>
</configuration>
<goals>
<goal>java</goal>
</goals>
</execution>
<!-- mvn test-compile && mvn exec:java@update-proj-regression-files -->
<execution>
<id>update-proj-regression-files</id>
<configuration>
<classpathScope>test</classpathScope>
<mainClass>org.openstreetmap.josm.data.projection.ProjectionRegressionTest</mainClass>
</configuration>
<goals>
<goal>java</goal>
</goals>
</execution>
<!-- mvn compile && mvn exec:java@SyncEditorLayerIndex -->
<execution>
<id>SyncEditorLayerIndex</id>
<configuration>
<executable>java</executable>
<arguments>
<argument>-Djava.awt.headless=true</argument>
<argument>-classpath</argument>
<classpath/> <!-- Generates the actual classpath using all project dependencies -->
<argument>${scripts.src.dir}/SyncEditorLayerIndex.java</argument>
<argument>${basedir}</argument>
</arguments>
<!-- We need commons-lang3, which isn't needed elsewhere in core (besides a test or two) -->
<classpathScope>test</classpathScope>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
<!-- Note that the epsg-touch/epsg executions are NOT duplicates - the first epsg makes an empty file for the
next run, which makes a non-empty custom-epsg file -->
<execution>
<id>epsg-touch</id>
<configuration>
<executable>java</executable>
<arguments>
<argument>-Djava.awt.headless=true</argument>
<argument>-classpath</argument>
<classpath/> <!-- Generates the actual classpath using all project dependencies -->
<argument>${basedir}/scripts/BuildProjectionDefinitions.java</argument>
<argument>${basedir}</argument>
</arguments>
</configuration>
<phase>process-classes</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
<execution>
<id>epsg</id>
<configuration>
<executable>java</executable>
<arguments>
<argument>-Djava.awt.headless=true</argument>
<argument>-classpath</argument>
<classpath/> <!-- Generates the actual classpath using all project dependencies -->
<argument>${basedir}/scripts/BuildProjectionDefinitions.java</argument>
<argument>${basedir}</argument>
</arguments>
</configuration>
<phase>generate-test-resources</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>ggjulio
Metadata
Metadata
Assignees
Labels
No labels