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

chore: drop legacy, use resolver #560

Merged
merged 7 commits into from
May 22, 2023
Merged

Conversation

cstamas
Copy link
Contributor

@cstamas cstamas commented May 18, 2023

Changes:

  • skip uses of archaic classes, use resolver
  • update wrapper to latest, set wrapped Maven to 3.9.2
  • update ITs to mute "plugin validation"

cstamas added 2 commits May 18, 2023 22:11
Changes:
* skip uses of archaic classes, use resolver
* update wrapper to 3.9.2
* update ITs to mute "plugin validation"
@cstamas
Copy link
Contributor Author

cstamas commented May 18, 2023

@SoEBeS @khmarbaise Something is off re ITs: all IT classes are annotated with @MavenOption(MavenCLIOptions.NO_TRANSFER_PROGRESS) (on class level), but IT classes having more than one method on second and subsequent invocations have it not applied (there is download progress). Naturally same stands for "mute 3.9.2 plugin validation" as well...

Example: BasicIT groupid_artifactid_should_be_ok mvn-arguments:

/home/cstamas/.sdkman/candidates/maven/current/bin/mvn
-Dmaven.repo.local=/home/cstamas/Worx/openrewrite/rewrite-maven-plugin/target/maven-it/org/openrewrite/maven/BasicIT/groupid_artifactid_should_be_ok/.m2/repository
--no-transfer-progress
-Dorg.slf4j.simpleLogger.log.org.apache.maven.plugin.internal.DefaultPluginValidationManager=off
package

but BasicIT null_check_profile_activation:

/home/cstamas/.sdkman/candidates/maven/current/bin/mvn
-Dmaven.repo.local=/home/cstamas/Worx/openrewrite/rewrite-maven-plugin/target/maven-it/org/openrewrite/maven/BasicIT/null_check_profile_activation/.m2/repository
--settings
settings.xml
org.openrewrite.maven:rewrite-maven-plugin:4.47.0-SNAPSHOT:dryRun

(no progress and mute plugin validation missing)

@cstamas cstamas changed the title Update Plugin chore: drop legacy, use resolver May 18, 2023
@timtebeek timtebeek added the enhancement New feature or request label May 22, 2023
@timtebeek timtebeek mentioned this pull request May 22, 2023
Co-authored-by: Tim te Beek <timtebeek@gmail.com>
@timtebeek
Copy link
Contributor

I'm seeing one failure

ArtifactNotFoundException: Could not find artifact org.openrewrite.recipe:rewrite-testing-frameworks:jar:runtime:1.31.0 in central

Not sure if this change might be related.

-return repositorySystem.createArtifact(parts[0], parts[1], parts[2], "runtime", "jar");
+return new DefaultArtifact(parts[0], parts[1], "runtime", "jar", parts[2]);

Any insights there? I could also dive in; we already really appreciate you chiming in with this improvement here!

Any background as to what prompted you to contribute? Would love to help and discuss if there's anything more we can do.

@cstamas
Copy link
Contributor Author

cstamas commented May 22, 2023

Yup, I mixed up two methods of old "repo sys" the createArtifact and same *withClassifier (assumed "runtime" is classifier, but is actually scope), fixing it.

cstamas added 2 commits May 22, 2023 15:11
"runtime" is not classifier, it is scope.
As this is redundant, plexus component will anyway use Maven
provided container instead (and it generates warning for plugin
as well).
@cstamas
Copy link
Contributor Author

cstamas commented May 22, 2023

re contribution: was really just led to this project while was looking how Quarkus handles "project upgrade" of theirs... and as Maven dev, just wanted to give plugin an update (as it emits warning with Maven 3.9.x due use of ArtifactRepository type that misbehaves when "split repo: feature of new Maven is used, see https://issues.apache.org/jira/browse/MNG-7706).

Co-authored-by: Tim te Beek <timtebeek@gmail.com>
@timtebeek
Copy link
Contributor

re contribution: was really just led to this project while was looking how Quarkus handles "project upgrade" of theirs... and as Maven dev, just wanted to give plugin an update (as it emits warning with Maven 3.9.x due use of ArtifactRepository type that misbehaves when "split repo: feature of new Maven is used, see https://issues.apache.org/jira/browse/MNG-7706).

Appreciate the help! Already discussed with @mthmulders if there's anything we can do for Maven 4, such as reproducible builds by inserting plugin version numbers through a recipe, as well as dropping now optional parent version numbers. Happy to think through any other use cases you might have to help Maven developers & users.

@timtebeek timtebeek merged commit 4649755 into openrewrite:main May 22, 2023
@cstamas
Copy link
Contributor Author

cstamas commented May 22, 2023

Am actually in process of update (major, as it lags a lot of maintenance) the maven-archetype, and had a wild idea to "merry" the archetype and some sort of rewrite (so to say, to keep archetypes "live", not one off), but this is maybe not archetype thing (that is essentially "just" template), but some plugin that amalgamates the two: uses archetype for commands like "add new module" to existing project, that creates new module out of some archetype, while uses rewrite to wire up new module into parent etc.

Am just tinkering, will ping once I have scratches around it.

@cstamas cstamas deleted the update-plugin branch May 22, 2023 14:05
@timtebeek
Copy link
Contributor

Sure! Continuous maintenance on archetype-started projects sounds right up our alley with OpenRewrite and Moderne; Feel free to share your thoughts and progress, either here or via our public Slack.

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

Successfully merging this pull request may close these issues.

2 participants