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

Improve conflict handling of lifecycle mappings #549

Closed
kwin opened this issue Feb 2, 2022 · 8 comments · Fixed by #568
Closed

Improve conflict handling of lifecycle mappings #549

kwin opened this issue Feb 2, 2022 · 8 comments · Fixed by #568
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@kwin
Copy link
Member

kwin commented Feb 2, 2022

In case two extensions with overlapping lifecycle mapping (like PDE Connector and Sling IDE Tooling in

<artifactId>bnd-maven-plugin</artifactId>
and https://github.com/apache/sling-ide-tooling/blob/93bcb69fe7cfad6b68d5caf838a14d3bdf887b92/eclipse/eclipse-m2e-ui/lifecycle-mapping-metadata.xml#L32) are installed only the errors

Conflicting lifecycle mapping (plugin execution "biz.aQute.bnd:bnd-maven-plugin:6.1.0:bnd-process (execution: generate-osgi-metadata, phase: process-classes)"). To enable full functionality, remove the conflicting mapping and run Maven->Update Project Configuration.
Plugin execution not covered by lifecycle configuration: biz.aQute.bnd:bnd-maven-plugin:6.1.0:bnd-process (execution: generate-osgi-metadata, phase: process-classes)

are emitted for projects leveraging plugins which are affected by the conflicting lifecycle mapping and incremental support for that plugin & goal (in this example bnd-process) is completely disabled.

Instead in case of conflicts it should be possible for a user to decide on a per-project level which lifecycle mapping should be used.

@laeubi
Copy link
Member

laeubi commented Feb 2, 2022

@kwin thanks for your suggestion, do you plan to give it a try and provide a PR for this?

@laeubi laeubi added enhancement New feature or request help wanted Extra attention is needed labels Feb 2, 2022
@kwin
Copy link
Member Author

kwin commented Feb 2, 2022

@laeubi Not in the short-term I fear.

@laeubi laeubi added this to the 1.20.0 milestone Feb 4, 2022
@laeubi
Copy link
Member

laeubi commented Feb 4, 2022

@mickaelistria @HannesWell could you help here? I think this can become important once we release 1.20 as there might also be collisions with the old takari mapping for tycho.

@mickaelistria
Copy link
Contributor

I don't plan to work on this issue. If the solution is to remove the old takari mapping of Tycho, then we can imagine have the m2e-PDE feature adding a negative requirement towards the takari stuff so we at least ensure both cannot be installed together.

@laeubi
Copy link
Member

laeubi commented Feb 4, 2022

Okay I'll try to take a look at this I think this is crucial for this release as we will otherwise get complains from users and the current behavior is simply not helpful.

@laeubi laeubi self-assigned this Feb 4, 2022
@HannesWell
Copy link
Contributor

Okay I'll try to take a look at this I think this is crucial for this release as we will otherwise get complains from users and the current behavior is simply not helpful.

Thank you Christoph! I agree that this is important but I actually didn't have the plan to work on this, so I'm thankful that you take over. If you need somebody to review, please let me know.

laeubi added a commit to laeubi/m2e-core that referenced this issue Feb 5, 2022
- record what is causing the conflict
- add the exception to the maven problem
- show problem markers at the correct location in the pom

Signed-off-by: Christoph Läubrich <[email protected]>
laeubi added a commit to laeubi/m2e-core that referenced this issue Feb 5, 2022
- record what is causing the conflict
- add the exception to the maven problem
- show problem markers at the correct location in the pom

Signed-off-by: Christoph Läubrich <[email protected]>
laeubi added a commit to laeubi/m2e-core that referenced this issue Feb 6, 2022
- record what is causing the conflict
- add the exception to the maven problem
- show problem markers at the correct location in the pom

Signed-off-by: Christoph Läubrich <[email protected]>
laeubi added a commit to laeubi/m2e-core that referenced this issue Feb 6, 2022
- record what is causing the conflict
- add the exception to the maven problem
- show problem markers at the correct location in the pom
- save conflicting configurator ids for executions

Signed-off-by: Christoph Läubrich <[email protected]>
laeubi added a commit to laeubi/m2e-core that referenced this issue Feb 6, 2022
- record what is causing the conflict
- add the exception to the maven problem
- show problem markers at the correct location in the pom
- save conflicting bundles at the marker

Signed-off-by: Christoph Läubrich <[email protected]>
laeubi added a commit to laeubi/m2e-core that referenced this issue Feb 7, 2022
- record what is causing the conflict
- add the exception to the maven problem
- show problem markers at the correct location in the pom
- save conflicting bundles at the marker

Signed-off-by: Christoph Läubrich <[email protected]>
laeubi added a commit that referenced this issue Feb 7, 2022
- record what is causing the conflict
- add the exception to the maven problem
- show problem markers at the correct location in the pom
- save conflicting bundles at the marker

Signed-off-by: Christoph Läubrich <[email protected]>
@laeubi
Copy link
Member

laeubi commented Feb 7, 2022

This is how it will look like for a execution phase with duplicate mappings:

grafik

This for a duplicate packaging type mapping:

grafik

laeubi added a commit to laeubi/m2e-core that referenced this issue Feb 7, 2022
Signed-off-by: Christoph Läubrich <[email protected]>
@laeubi
Copy link
Member

laeubi commented Feb 7, 2022

This then adds for example the following to the workspace metadata:

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
  <lifecycleMappingFilters>
    <lifecycleMappingFilter>
      <symbolicName>org.sonatype.tycho.m2e</symbolicName>
      <versionRange>[0.9.0,)</versionRange>
      <packagingTypes>
        <packagingType>bundle</packagingType>
      </packagingTypes>
    </lifecycleMappingFilter>
  </lifecycleMappingFilters>
</lifecycleMappingMetadata>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants