I wrote a maven plugin that I'm using on some projects. In the first project, it only has one execution and I can execute the plugin directly with
mvn com.mycompany:my-plugin:0.0.1-SNAPSHOT:do-stuff
In the second project, the plugin has multiple executions and when I try the above command, I end up blowing up because the plugin tries to execute with empty parameters.
Note that in both cases, the plugin works fine when executed as part of the process-resources phase. It only fails when I try to execute just the plugin goal. Can someone help me understand why the second example tries to execute with blank parameters?
First project (one execution - works fine):
<plugin>
<groupId>com.mycompany</groupId>
<artifactId>my-plugin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<configuration>
<sourceFiles>
<sourceFile>loadfile</sourceFile>
</sourceFiles>
<outputFile>outputFile</outputFile>
</configuration>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>do-stuff</goal>
</goals>
</execution>
</executions>
</plugin>
Second project (multiple executions - does not wok):
<plugin>
<groupId>com.my-company</groupId>
<artifactId>my-plugin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<executions>
<execution>
<id>default</id>
<phase>process-resources</phase>
<configuration>
<sourceFiles>
<sourceFile>file1</sourceFile>
</sourceFiles>
<outputFile>outputFile</outputFile>
</configuration>
<goals>
<goal>do-stuff</goal>
</goals>
</execution>
<execution>
<id>novice</id>
<phase>process-resources</phase>
<configuration>
<sourceFiles>
<sourceFile>file1</sourceFile>
<sourceFile>file2</sourceFile>
</sourceFiles>
<outputFile>outputFile</outputFile>
</configuration>
<goals>
<goal>do-stuff</goal>
</goals>
</execution>
</executions>
</plugin>