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

Bug 368102

Summary: Ability to skip plugin execution
Product: z_Archived Reporter: Michel Krämer <michel.kraemer>
Component: TychoAssignee: Project Inbox <tycho-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: adrianp.quatinus, igor, jan.sievers
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Michel Krämer CLA 2012-01-08 08:20:09 EST
Build Identifier: 

Suppose you're building a product for win32 and later decide to build it for linux as well. tycho-compiler-plugin and tycho-packaging-plugin are then executed again. But if you know that nothing has changed in between, it would be nice to be able to skip execution of these plugins.

This is a little bit related to the following maven issue:
http://jira.codehaus.org/browse/MNG-3321

Reproducible: Always
Comment 1 Adrian Price CLA 2017-06-16 05:54:41 EDT
(In reply to Michel Krämer from comment #0)

Agreed. In a complex product with many Maven modules, a reliable incremental build capability is important, as are any build performance enhancement measures. Maven doesn't have any built-in support for up-to-date checking and this is generally the responsibility of individual plug-ins. However, many plug-ins do not or cannot efficiently determine up-to-date-ness (for example, it's hard to see how tycho-compiler-plugin could determine this without launching Eclipse).

Now, it is a well-established pattern for a Mojo's configuration to include a 'skip' property.

I contributed the uptodate-property and uptodate-properties goals to the popular org.codehaus.mojo:build-helper-maven-plugin - these goals can check output files for up-to-date-ness with respect to their source files and set a boolean property which can then be used to skip a subsequent plug-in execution if it has been determined that it is not required.

So, please may we have 'skip' configuration properties for ALL Tycho goals? It should be simplicity itself to implement.

Thanks!
Comment 2 Jan Sievers CLA 2017-06-19 04:45:51 EDT
(In reply to Michel Krämer from comment #0)
> Build Identifier: 
> 
> Suppose you're building a product for win32 and later decide to build it for
> linux as well. tycho-compiler-plugin and tycho-packaging-plugin are then
> executed again. But if you know that nothing has changed in between, it
> would be nice to be able to skip execution of these plugins.

tycho-compiler-plugin will only compile source file that are newer than their respective .class files. If you change nothing and omit the clean lifecycle, it's a nop:

[DEBUG] Output directory: /Users/d037913/git/eclipse/org.eclipse.tycho-demo/itp01/tycho.demo.itp01.tests/target/classes
[INFO] Nothing to compile - all classes are up to date

Similarly, tycho-packaging plugin should support 

      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-packaging-plugin</artifactId>
        <version>${tycho-version}</version>
        <configuration>
          <archive>
            <forced>false</forced>
          </archive>
        </configuration>
      </plugin>

which should update the jar file with changed files only, see [1]. For now this has been disabled due to a bug with source jars with commit

https://github.com/sonatype/sonatype-tycho/commit/93636a86c19c488602d64543a93bf0494d0d2894

may revisit this and add proper support for jar file updating.

[1] https://maven.apache.org/shared/maven-archiver/
Comment 3 Igor Fedorenko CLA 2017-06-19 07:34:11 EDT
Correct incremental java compilation is hard and from a quick look I believe Tycho does not do it right. It seems to completely ignore changes to compilation classpath, so build results may be wrong when project dependencies change. Even within the project, Tycho compiler ignores changes to referenced types and may not recompile sources it should. It may also leave stale .class files if project sources happen to use secondary types. My recommend always using "clean" with Tycho builds.
Comment 4 Mickael Istria CLA 2021-04-08 18:06:59 EDT
Eclipse Tycho is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/tycho/issues/ instead. If this issue is relevant to you, your action is required.
0. Verify this issue is still happening with latest Tycho 2.4.0-SNAPSHOT
  if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done
  if issue is still present when latest release:
* Create a new issue at https://github.com/eclipse/tycho/issues/
  ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  ** In the GitHub description, start with a link to this bugzilla ticket
  ** Optionally add new content to the description if it can helps towards resolution
  ** Submit GitHub issue
* Update bugzilla ticket
  ** Add to "See also" property (up right column) the link to the newly created GitHub issue
  ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  ** Set status as CLOSED MOVED
  ** Submit

All issues that remain open will be automatically closed next week or so. Then the Bugzilla component for Tycho will be archived and made read-only.