Maven ignores execution configuration when specific execution is in progress

I have a Maven plugin configuration that I want to run from the CLI. It looks like this:

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>dbunit-maven-plugin</artifactId>
            <version>1.0-beta-3</version>
            <configuration>
                <driver>${knossos.jdbc.driver}</driver>
                <url>${knossos.jdbc.url}</url>
                <username>${knossos.jdbc.user}</username>
                <password>${knossos.jdbc.password}</password>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>com.mycompany</groupId>
                    <artifactId>db</artifactId>
                    <version>${project.version}</version>
                </dependency>
            </dependencies>
            <executions>
                <execution>
                    <id>fill-dabatase</id>
                    <phase>test</phase>
                    <goals>
                        <goal>operation</goal>
                    </goals>
                    <configuration>
                        <type>INSERT</type>
                        <src>src/test/resources/data/full.xml</src>
                    </configuration>
                </execution>
            </executions>
        </plugin>

      

According to new Maven feature, I am doing

mvn initialize dbunit:operation@fill-database

      

This should execute, but it does not fail when getting the "src" and "type" config parameters

[ERROR] Failed to execute goal org.codehaus.mojo:dbunit-maven-plugin:1.0-beta-3:operation (fill-database) on project KnossosWebApp: The parameters 'src', 'type' for goal org.codehaus.mojo:dbunit-maven-plugin:1.0-beta-3:operation are missing or invalid -> [Help 1]

      

But when I do the same execution even though the Maven phase is "test", it works fine.

mvn test

      

Is the Maven plugin a problem? As a temporary workaround, I moved the run configuration to the plugin config. So it works for both phases and execution targets.

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>dbunit-maven-plugin</artifactId>
            <version>1.0-beta-3</version>
            <configuration>
                <driver>${knossos.jdbc.driver}</driver>
                <url>${knossos.jdbc.url}</url>
                <username>${knossos.jdbc.user}</username>
                <password>${knossos.jdbc.password}</password>
                <type>INSERT</type>
                <src>src/test/resources/data/full.xml</src>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>com.mycompany</groupId>
                    <artifactId>db</artifactId>
                    <version>${project.version}</version>
                </dependency>
            </dependencies>
            <executions>
                <execution>
                    <id>fill-dabatase</id>
                    <phase>test</phase>
                    <goals>
                        <goal>operation</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

      

+3
java maven


source to share


No one has answered this question yet

Check out similar questions:

2240
How to create an executable JAR with dependencies using Maven?
866
How to solve "Executing plugins not covered by lifecycle config" for Spring Data Maven Builds
291
Maven fails on Java 8 when Javadoc tags are incomplete
196
Maven Run Project
73
Run one execution of a Maven plugin?
8
Maven, configure specific target
7
Check existence of lifecycle / phase and file in Maven and report a bug
3
Maven ignores run configuration
1
Setting object type of Maven property
0
Call maven-invoker-plugin at a specific phase


Loading...
X
Show
Funny
Dev
Pics