mojohaus / mojohaus/exec-maven-plugin

The parameter 'executable' is missing or invalid

Open
#430 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
191
Forks
111
Avg merge
1d 21h
Merged PRs (30d)
4

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 on mvn clean test-compile or mvn clean package)
    • These tasks are bound to phases that run after compile but before test-compile
  • 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-epsg

What I've looked at:

[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>

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the exec-maven-plugin executions in the POM on the pom branch, especially epsg-touch and epsg, then reproduce with mvn clean compile exec:exec@epsg-touch exec:exec@epsg. Compare that result with mvn clean test-compile, where target/classes/data/projection/custom-epsg is populated. Done means both executions work when invoked manually and the generated file is non-empty.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.