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

MNG-7400 - Allow more WorkspaceReader's to participate #667

Closed
wants to merge 1 commit into from

Conversation

laeubi
Copy link

@laeubi laeubi commented Jan 29, 2022

We at Tycho have a high demand in integrating better with maven to reduce some workarounds that where used in the past to get custom dependency types into the maven dependency model (namely using system scoped absolute paths).

For that reason it would help if it where possible to register additional WorkspaceReader to participate.

I have created a prototype to show/test this new feature.

FYI @mickaelistria @akurtakov

This PR allows maven-extensions to supply WorkspaceReader as it is possible with AbstractMavenLifecycleParticipant currently it is only possible with some workarounds:

  1. One needs to register a AbstractMavenLifecycleParticipant in a maven-core-extension
  2. In the afterSessionStart cast the RepositorySystemSession to DefaultRepositorySystemSession
  3. Call setWorkspaceReader and take care not to replace an already exiting one

With this change it is possible to simply register WorkspaceReader component directly and Maven takes care of all the rest.

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [MNG-XXX] SUMMARY, where you replace MNG-XXX
    and SUMMARY with the appropriate JIRA issue. Best practice is to use the JIRA issue
    title in the pull request title and in the first line of the commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the Core IT successfully.

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

Copy link
Contributor

@mthmulders mthmulders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for contributing.

I'm not done yet with the review (I just need a bigger screen which I don't have available at this moment); I'd like to take a more thorough look soon.

In the meantime, would you be so kind to revert the unrelated change in imports? It allows us to focus on the actual changes you're proposing. Thanks!

@laeubi
Copy link
Author

laeubi commented Jan 29, 2022

I'm not done yet with the review (I just need a bigger screen which I don't have available at this moment); I'd like to take a more thorough look soon.

Thanks for looking into this, there is currently an issue that this also finds the org.apache.maven.ReactorReader I'm currently try to find out how to avoid this as this obviously is not what one wants :-/

I'll try to cleanup the unrelated parts, it just seems the Eclipse-Formater likes to format more than desired here...

@laeubi laeubi force-pushed the MNG-7400 branch 2 times, most recently from 53244e4 to edbc026 Compare January 29, 2022 16:35
@laeubi
Copy link
Author

laeubi commented Jan 29, 2022

In the meantime, would you be so kind to revert the unrelated change in imports? It allows us to focus on the actual changes you're proposing. Thanks!

Done! mvn clean verify also runs without test or checkstyle errors now!

@laeubi
Copy link
Author

laeubi commented Jan 29, 2022

I have uploaded my "HelloWorld" here: https://github.com/eclipse/tycho/pull/586/files

Copy link
Contributor

@mthmulders mthmulders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your patience. I was able to have a better look now and I left a couple of questions.

@michael-o
Copy link
Member

@laeubi Please address the open comments before I am merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants