Hi,
Doh –
thanks that fixed it ☺

A follow-on question

Is it possible to limit the phases for which the plugin is activated?
I have a reasonable complex ant configuration ( that runs mostly for the 
package phase), but I only want the m2e to run a small subset

For ant there is only one goal , and it runs for all phases, so I can’t limit 
effectively by goal

Regards
Mike

From: [email protected] [mailto:[email protected]] On 
Behalf Of Adrien Rivard
Sent: 09 January 2013 13:27
To: Maven Integration for Eclipse users mailing list
Subject: Re: [m2e-users] newbe - basic m2e ant integration problem

Hi,

Your <executions> are not correct, they don't work in command line either.
Errors are :
- duplicate execution id (this one seems to be ok for m2e though)
- missing goal
- file="${project.build.directory}/target/process-resources.txt" => 
file="${project.build.directory}/process-resources.txt"

Be sure to refresh after build, this is not expected to happen automatically.


try with
    <executions>
                    <execution>
                        <id>ant-build</id>
                        <phase>process-resources</phase>
                        <configuration>
                            <target>
                                <echo message="process-resources 1 " />
                                <echo message="process-resources 1 " 
file="${project.build.directory}/process-resources.txt" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>ant-build2</id>
                        <phase>compile</phase>
                        <configuration>
                            <target>
                                <echo message="compile 1 " />
                                <echo message="compile 1 " 
file="${project.build.directory}/compile.txt" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>


On Wed, Jan 9, 2013 at 2:12 PM, Igor Fedorenko 
<[email protected]<mailto:[email protected]>> wrote:
m2e is expected to execute antrun-plugin with the configuration you
quoted in original email. Most like it gets executed, but the filtered
resources then get removed from the output folder by the jdt builder,
i.e. item a) of my definition of "proper" does not hold.

--
Regards,
Igor


On 2013-01-09 7:32 AM, Skells, Mike wrote:
Hi Igor,
I appreciate that the ant task will have to be carefully written, but why is it 
not being called?

Does m2e maintain a list of plugins that it regards as safe and ignore the 
others, this just seems to be silently failing - is that the expected behaviour?

I presumed that I had a configuration error in the pom

In the actual case we only want to do some filtering, (but differently to the 
resources:resources filter is a few subtle ways)

Regards
Mike

-----Original Message-----
From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]<mailto:[email protected]>] On 
Behalf Of Igor Fedorenko
Sent: 09 January 2013 12:23
To: [email protected]<mailto:[email protected]>
Subject: Re: [m2e-users] newbe - basic m2e ant integration problem

You can't properly integrate antrun-plugin in m2e workspace build unless 
somebody makes changes to the plugin to at least respect workspace resource 
change delta... which most likely means changing all ant tasks executed from 
within m2e build and extremely unlikely to happen.

By "properly integrate" I mean a) generated resources reliably appear in the 
output folder when they should and b) there are no endless workspace builds.

--
Regards,
Igor

On 2013-01-08 7:01 PM, Skells, Mike wrote:
Hi,
I am attempting to use ant to participate in to the eclipse build and I cant 
seem to get it working.

I expect to have ant in several phases some inrelated to eclipse and
some co-operating

With the pom below I get no interaction.
I have read http://wiki.eclipse.org/M2E_plugin_execution_not_covered
and I tbelieve that it is configured corerectly, but I must be missing
something

I have tried with eclipse 3.7 and 4.2, and latest m2e


<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
    <modelVersion>4.0.0</modelVersion>
    <groupId>mike</groupId>
    <artifactId>mike</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>mike</name>

        <properties>
          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>

      <build>
          <plugins>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-antrun-plugin</artifactId>
                  <version>1.7</version>

                  <executions>
                      <execution>
                          <id>ant-build</id>
                          <phase>process-resources</phase>
                          <configuration>
                              <target>
                                  <echo message="process-resources 1 "/>
                                  <echo message="process-resources 1 " 
file="${project.build.directory}/target/process-resources.txt"/>
                              </target>
                          </configuration>
                      </execution>
                      <execution>
                          <id>ant-build</id>
                          <phase>compile</phase>
                          <configuration>
                              <target>
                                  <echo message="compile 1 "/>
                                  <echo message="compile 1 " 
file="${project.build.directory}/target/compile.txt"/>
                              </target>
                          </configuration>
                      </execution>
                  </executions>
                  <dependencies>
                      <dependency>
                          <groupId>org.apache.ant</groupId>
                          <artifactId>ant</artifactId>
                          <version>1.8.2</version>
                      </dependency>
                  </dependencies>
              </plugin>

          </plugins>
          <pluginManagement>
              <plugins>
                  <plugin>
                      <groupId>org.eclipse.m2e</groupId>
                      <artifactId>lifecycle-mapping</artifactId>
                      <version>1.0.0</version>
                      <configuration>
                          <lifecycleMappingMetadata>
                              <pluginExecutions>
                                  <pluginExecution>
                                      <pluginExecutionFilter>
                                          
<groupId>org.apache.maven.plugins</groupId>
                                          
<artifactId>maven-antrun-plugin</artifactId>
                                          <versionRange>[1,7,)</versionRange>
                                          <goals>
                                              <goal>run</goal>
                                          </goals>
                                      </pluginExecutionFilter>
                                      <action>
                                          <execute>
                                              
<runOnIncremental>true</runOnIncremental>
                                              
<runOnConfiguration>true</runOnConfiguration>
                                          </execute>
                                      </action>
                                  </pluginExecution>
                              </pluginExecutions>
                          </lifecycleMappingMetadata>
                      </configuration>
                  </plugin>
              </plugins>
          </pluginManagement>

      </build>

</project>
_______________________________________________
m2e-users mailing list
[email protected]<mailto:[email protected]>
https://dev.eclipse.org/mailman/listinfo/m2e-users
_______________________________________________
m2e-users mailing list
[email protected]<mailto:[email protected]>
https://dev.eclipse.org/mailman/listinfo/m2e-users
_______________________________________________
m2e-users mailing list
[email protected]<mailto:[email protected]>
https://dev.eclipse.org/mailman/listinfo/m2e-users
_______________________________________________
m2e-users mailing list
[email protected]<mailto:[email protected]>
https://dev.eclipse.org/mailman/listinfo/m2e-users



--
Adrien Rivard
06 63 08 79 74
_______________________________________________
m2e-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/m2e-users

Reply via email to