Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip Tycho dependency resolution for clean-only builds by default #166

Closed
HannesWell opened this issue Jul 1, 2021 · 2 comments · Fixed by #168
Closed

Skip Tycho dependency resolution for clean-only builds by default #166

HannesWell opened this issue Jul 1, 2021 · 2 comments · Fixed by #168
Milestone

Comments

@HannesWell
Copy link
Member

When you want to clean Eclipse projects build with Maven/Tycho the dependency resolution is performed initially by default, even tough it is not necessary (please correct me if I'm wrong). For large projects the dependency resolution takes the vast majority of runtime in a clean-only build.

In order to speed-up clean builds, one can specify the property -Dtycho.mode=maven to skip the dependency resolution.

For convenience (on the command-line and in the IDE) and to speed up cleans for users that do not know about the mentioned property I suggest to skip the dependency resolution by default for clean only builds.
This could be accomplished in TychoMavenLifecycleParticipant.disableLifecycleParticipation(Seesion) by checking if the session only has the goal "clean".

If nothing else speaks against it, I can provide a patch to change that default behavior for clean-only builds.

@mickaelistria
Copy link
Contributor

Tycho somehow modifies the Maven model by adding dependencies, but AFAIK,it does affect the typical "dirty" directories that clean is supposed to process. So ok, let's try it!

@HannesWell
Copy link
Member Author

Tycho somehow modifies the Maven model by adding dependencies, but AFAIK,it does affect the typical "dirty" directories that clean is supposed to process. So ok, let's try it!

You meant does not affect, don't you?

Because yes, the modifications of the Maven-model performed by Tycho in TychoMavenLifecycleParticipant.afterProjectsRead do affect the model, but I think they are not necessary for running a clean build.
At least I got that impression when looking at TychoMavenLifecycleParticipant.afterProjectsRead(MavenSession) and what happens after the initial if statement that calls disableLifecycleParticipation(MavenSession).
The additional validation and configuration performed here seems unnecessary for cleaning and skipping the dependency resolution is the intention of this change.

I'm about to open a PR to address this.

HannesWell added a commit to HannesWell/tycho that referenced this issue Jul 2, 2021
…ilds by default

Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
HannesWell added a commit to HannesWell/tycho that referenced this issue Jul 2, 2021
…ilds by default

Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
mickaelistria pushed a commit that referenced this issue Jul 2, 2021
Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
HannesWell added a commit to HannesWell/tycho that referenced this issue Jul 3, 2021
HannesWell added a commit to HannesWell/tycho that referenced this issue Jul 9, 2021
If default goals are used Maven can be invoked without specifying goals
explicitly in the command, so the List of goals is empty.

This had the consequence, that the AbstractMavenLifecycleParticipant
false detected a clean-only build and skipped dependency/target-platform
resolution, which lead to follow up errors.

The logic to detect 'clean-only' builds is improved to consider the
described case.

Change-Id: I68b7abf61835665a648a0bc006153c4631b56ff8
Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
HannesWell added a commit to HannesWell/tycho that referenced this issue Jul 9, 2021
…ion from eclipse-tycho#166)

If default goals are used Maven can be invoked without specifying goals
explicitly in the command, so the List of goals is empty.

This had the consequence, that the AbstractMavenLifecycleParticipant
false detected a clean-only build and skipped dependency/target-platform
resolution, which lead to follow up errors.

The logic to detect 'clean-only' builds is improved to consider the
described case.

Change-Id: I68b7abf61835665a648a0bc006153c4631b56ff8
Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
HannesWell added a commit to HannesWell/tycho that referenced this issue Jul 9, 2021
…ion from eclipse-tycho#166)

If default goals are used Maven can be invoked without specifying goals
explicitly in the command, so the List of goals is empty.

This had the consequence, that the AbstractMavenLifecycleParticipant
false detected a clean-only build and skipped dependency/target-platform
resolution, which lead to follow up errors.

The logic to detect 'clean-only' builds is improved to consider the
described case.
mickaelistria pushed a commit that referenced this issue Jul 9, 2021
If default goals are used Maven can be invoked without specifying goals
explicitly in the command, so the List of goals is empty.

This had the consequence, that the AbstractMavenLifecycleParticipant
false detected a clean-only build and skipped dependency/target-platform
resolution, which lead to follow up errors.

The logic to detect 'clean-only' builds is improved to consider the
described case.
mickaelistria pushed a commit that referenced this issue Jul 13, 2021
If default goals are used Maven can be invoked without specifying goals
explicitly in the command, so the List of goals is empty.

This had the consequence, that the AbstractMavenLifecycleParticipant
false detected a clean-only build and skipped dependency/target-platform
resolution, which lead to follow up errors.

The logic to detect 'clean-only' builds is improved to consider the
described case.
@laeubi laeubi added this to the 2.4 milestone Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants