Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369302

Summary: org.sonatype.tycho:maven-tycho-plugin:generate-poms fails to consider settings in .externalToolbuilders
Product: z_Archived Reporter: Karl Trygve Kalleberg <karltk>
Component: TychoAssignee: Project Inbox <tycho-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: igor
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Karl Trygve Kalleberg CLA 2012-01-20 17:29:15 EST
Build Identifier: 0.11.1

I am building a feature where some of the plugins are configured with external tools builders as part of their build process. They all use the Eclipse-bundled Ant builder -- i.e., the Ant builder is their sole external tool builder.

The generated pom.xml file created by Tycho fails to invoke Ant with the necessary target parameters. 

The only solution I have found is to manually fix up the pom.xml files after invoking generate-poms, but before mvn package.

Example boilerplate that I have to add:
  <build>
    <plugins>
 <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <executions>
       <execution>
               <id>generate-sources</id>
               <phase>generate-sources</phase>
               <configuration>
                  <tasks>
                          <echo>Running ant script</echo>
                          <ant antfile="build.ant.xml" inheritRefs="true">
                              <target name="bundle-ctree" />
                          </ant>
                  </tasks>
               </configuration>
               <goals>
                  <goal>run</goal>
               </goals>
       </execution>
    </executions>
  </plugin>
    </plugins>
</build>

In this case, "bundle-ctree" is the Ant target that my plugin wants to have run as part of the build process. It configured for the external ant builder in the relevant tool builder .launch file:

<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="bundle-ctree"/>


As long as I do not configure external tool builders, Tycho seems to behave nicely, so I suppose this is just a feature mismatch between Tycho and the internal PDE build system that hopefully could get fixed soon.

Reproducible: Always

Steps to Reproduce:
In Eclipse:
1. Create a simple feature, update site and a lone plugin Foo.
2. Add a tiny build.ant.xml file to the Foo plugin with a target "dummy" that creates or touches a file called dummy.txt.
3. Add an Ant builder to the Foo plugin project that invokes the dummy target.
4. Verify that the dummy.txt file is created.
5. In build.properties, add dummy.txt to bin.includes.

In Maven:
1. Run mvn generate-poms for the above project.
2. Notice how the pom.xml doesn't invoke the build.ant.xml.
Comment 1 Igor Fedorenko CLA 2012-01-20 19:46:51 EST
Eclipse workspace builders integration is outside of the scope for Tycho. Tycho implements drastically different build approach to what happens in Eclipse workspace and there are no plans to change that.