Hello,

One task 'foo' is called 3 times and it should be only one:
in a super pom, I want jar with sources, test ... (default for all project).
in my pom I want to call 'foo' at the phase generate-sources.

the first  call is made by the expected execution id1 at the beginning.
the second call is made by side effect of base_id1.
the third  call is made by side effect of base_id2.

The same issue raises with the ant plugin instead of exec-maven-plugin.

What's wrong?
It seems that a 'forked' lifecycle is launched with each base_id execution 
and that my id1 execution is bind on this new lifecycle too.
Is it possible to act on this?

Thanks.


in my top level pom there's something like this
<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
                <execution>
                        <id>base_id1</id>
                        <goals>
                                <goal>test-jar</goal>
                        </goals>
                </execution>
        </executions>
</plugin>
<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
                <execution>
                        <id>base_id2</id>
                        <phase>verify</phase>
                        <goals>
                                <goal>jar</goal>
                                <goal>test-jar</goal>
                        </goals>
                </execution>                                                    
        </executions>
</plugin>
                                        
in my pom there's
<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
                <execution>
                        <id>id1</id>
                        <phase>generate-sources</phase>
                        <goals>
                                <goal>exec</goal>
                        </goals>
                        <configuration>
                                <executable>foo</executable>
                        </configuration>
                </execution>
        </executions>
</plugin>

here's part of the log
...
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[INFO] Building jar: 
[INFO] [jar:test-jar {execution: base_id1}]
[INFO] Building jar: 
[INFO] Preparing source:jar
[INFO] [exec:exec {execution: id1}]
...
[INFO] [source:jar {execution: base_id2}]
[INFO] Building jar:
D:\pvcs\Canalito_dev\dev\canalito\canalitoCore\CanalitoComMixte\target\Canalit
T-sources.jar
[INFO] Preparing source:test-jar
[WARNING] Removing: jar from forked lifecycle, to prevent recursive
invocation.
[WARNING] Removing: test-jar from forked lifecycle, to prevent recursive
invocation.
[INFO] [exec:exec {execution: id1}]
...
[INFO] [source:test-jar {execution: base_id2}]
[INFO] Building jar: -test-sources.jar
[INFO] [install:install]

-- 
View this message in context: 
http://www.nabble.com/M2---side-effect-with-phase-tf2416952.html#a6737330
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to