Sylwester Lachiewicz created FELIX-6898:
-------------------------------------------

             Summary: Move maven-bundle-plugin off deprecated Maven APIs and 
Plexus-style injection
                 Key: FELIX-6898
                 URL: https://issues.apache.org/jira/browse/FELIX-6898
             Project: Felix
          Issue Type: Task
          Components: Maven Bundle Plugin
            Reporter: Sylwester Lachiewicz


maven-bundle-plugin still builds against maven-compat and injects components 
with the deprecated @Component mojo annotation. Maven 3.9 warns about the 
compatibility layer (FELIX-6606), and Maven 4 may not support it. This issue 
tracks the steps; each step lands as its own issue and PR, in this order, 
because later steps delete code the earlier ones touch.

# FELIX-6896 ([PR #617|https://github.com/apache/felix-dev/pull/617]): replace 
MavenProjectBuilder and ArtifactCollector in BundlePlugin and BundleAllPlugin.
# FELIX-6876 ([PR #592|https://github.com/apache/felix-dev/pull/592]): remote 
OBR goals look up the Wagon from the plugin container instead of maven-compat's 
WagonManager. Open review points: whether to bundle wagon-file/wagon-http, and 
the lock handling in ObrDeploy, ObrDeployFile and ObrRemoteClean.
# Replace the remaining maven-compat types (ArtifactFactory, 
ArtifactMetadataSource, the legacy ArtifactResolver) in BundlePlugin, 
BundleAllPlugin, AbstractBaselinePlugin and AbstractFileMojo with the resolver 
RepositorySystem and ProjectDependenciesResolver, then drop the maven-compat 
dependency. Resolves FELIX-6606.
# Align the build: one maven.version for maven-core, maven-model and 
maven-artifact (today 3.8.1 and 3.3.9), all in provided scope; declare 
requiredMavenVersion; maven-plugin-plugin (3.6.4) at the same version as 
maven-plugin-annotations (3.15.1); move tests from JUnit 4.13.2 and 
maven-plugin-testing-harness 3.3.0 to JUnit 5, dropping the aether-impl 1.1.0 
test dependency; replace org.sonatype.plexus:plexus-build-api 0.0.7 with 
org.codehaus.plexus:plexus-build-api, after checking m2e incremental builds.
# Replace the 24 @Component fields in 9 mojo classes with JSR-330 javax.inject 
(the plugin targets Java 8, which rules out jakarta.inject on Maven 3). 
VerifyBundlePlugin injects MavenProject as a component; that becomes 
@Parameter(defaultValue = "${project}", readonly = true).
# Run the integration tests on Maven 4 in CI as well as 3.9.

Done when maven-compat is no longer a dependency, src/main has no @Component, 
and the ITs pass on Maven 3.9.x and 4.0.x without plugin validation warnings.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to