diff --git a/DEPENDENCIES b/DEPENDENCIES index f1d7aff1..f9c46f27 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -112,11 +112,10 @@ maven/mavencentral/org.codehaus.plexus/plexus-component-annotations/2.1.0, Apach maven/mavencentral/org.codehaus.plexus/plexus-container-default/2.1.0, Apache-2.0, approved, clearlydefined maven/mavencentral/org.codehaus.plexus/plexus-utils/3.1.1, , approved, CQ16492 maven/mavencentral/org.codehaus.plexus/plexus-utils/3.3.0, , approved, CQ21066 -maven/mavencentral/org.eclipse.edc/autodoc-processor/+, Apache-2.0, approved, technology.edc +maven/mavencentral/org.eclipse.edc/autodoc-processor/0.8.2-SNAPSHOT, Apache-2.0, approved, technology.edc maven/mavencentral/org.eclipse.edc/boot-spi/0.8.2-SNAPSHOT, Apache-2.0, approved, technology.edc maven/mavencentral/org.eclipse.edc/core-spi/0.8.2-SNAPSHOT, Apache-2.0, approved, technology.edc maven/mavencentral/org.eclipse.edc/policy-model/0.8.2-SNAPSHOT, Apache-2.0, approved, technology.edc -maven/mavencentral/org.eclipse.edc/runtime-metamodel/0.8.2-20240819-SNAPSHOT, Apache-2.0, approved, technology.edc maven/mavencentral/org.eclipse.edc/runtime-metamodel/0.8.2-SNAPSHOT, Apache-2.0, approved, technology.edc maven/mavencentral/org.glassfish.web/javax.el/2.2.6, CDDL-1.0 OR GPL-2.0-only WITH Classpath-exception-2.0, approved, #1654 maven/mavencentral/org.hibernate.validator/hibernate-validator-annotation-processor/6.0.2.Final, Apache-2.0 AND LicenseRef-Public-Domain, approved, CQ20221 diff --git a/plugins/autodoc/autodoc-plugin/src/main/java/org/eclipse/edc/plugins/autodoc/AutodocDependencyInjector.java b/plugins/autodoc/autodoc-plugin/src/main/java/org/eclipse/edc/plugins/autodoc/AutodocDependencyInjector.java index 3a327898..21196adc 100644 --- a/plugins/autodoc/autodoc-plugin/src/main/java/org/eclipse/edc/plugins/autodoc/AutodocDependencyInjector.java +++ b/plugins/autodoc/autodoc-plugin/src/main/java/org/eclipse/edc/plugins/autodoc/AutodocDependencyInjector.java @@ -18,6 +18,7 @@ import org.gradle.api.artifacts.DependencyResolutionListener; import org.gradle.api.artifacts.ResolvableDependencies; import org.gradle.api.tasks.compile.JavaCompile; +import org.jetbrains.annotations.NotNull; import java.util.List; @@ -42,17 +43,7 @@ class AutodocDependencyInjector implements DependencyResolutionListener { @Override public void beforeResolve(ResolvableDependencies dependencies) { - var processorVersion = extension.getProcessorVersion(); - - var artifact = DEPENDENCY_NAME; - if (processorVersion.isPresent()) { - var version = processorVersion.get(); - artifact += ":" + version; - project.getLogger().debug("{}: use configured version from AutodocExtension (override) [{}]", project.getName(), version); - } else { - artifact += ":+"; - project.getLogger().info("No explicit configuration value for the annotationProcessor version was found. Current one will be used"); - } + var artifact = DEPENDENCY_NAME + ":" + getProcessorVersion(); if (addDependency(project, artifact)) { var task = project.getTasks().findByName("compileJava"); @@ -72,6 +63,20 @@ public void afterResolve(ResolvableDependencies dependencies) { } + private @NotNull String getProcessorVersion() { + var processorVersion = extension.getProcessorVersion(); + + if (processorVersion.isPresent()) { + var version = processorVersion.get(); + project.getLogger().debug("{}: use configured version from AutodocExtension (override) [{}]", project.getName(), version); + return version; + } else { + var version = project.getVersion().toString(); + project.getLogger().info("No explicit configuration value for the annotationProcessor version was found. Project version {} will be used", version); + return version; + } + } + /** * Adds an {@code annotationProcessor} dependency to the given project. * diff --git a/plugins/edc-build/src/main/java/org/eclipse/edc/plugins/edcbuild/extensions/BuildExtension.java b/plugins/edc-build/src/main/java/org/eclipse/edc/plugins/edcbuild/extensions/BuildExtension.java index 690a1aa8..6d07a031 100644 --- a/plugins/edc-build/src/main/java/org/eclipse/edc/plugins/edcbuild/extensions/BuildExtension.java +++ b/plugins/edc-build/src/main/java/org/eclipse/edc/plugins/edcbuild/extensions/BuildExtension.java @@ -24,21 +24,14 @@ * Root configuration resource for the EDC Build plugin */ public abstract class BuildExtension { - private final VersionsExtension versions; private final MavenPomExtension pom; private final SwaggerGeneratorExtension swagger; public BuildExtension(ObjectFactory objectFactory) { - versions = objectFactory.newInstance(VersionsExtension.class); pom = objectFactory.newInstance(MavenPomExtension.class); swagger = objectFactory.newInstance(SwaggerGeneratorExtension.class); } - - public void versions(Action action) { - action.execute(versions); - } - public void pom(Action action) { action.execute(pom); } @@ -47,10 +40,6 @@ public void swagger(Action action) { action.execute(swagger); } - public VersionsExtension getVersions() { - return versions; - } - public MavenPomExtension getPom() { return pom; } diff --git a/plugins/edc-build/src/main/java/org/eclipse/edc/plugins/edcbuild/extensions/VersionsExtension.java b/plugins/edc-build/src/main/java/org/eclipse/edc/plugins/edcbuild/extensions/VersionsExtension.java deleted file mode 100644 index 226859f2..00000000 --- a/plugins/edc-build/src/main/java/org/eclipse/edc/plugins/edcbuild/extensions/VersionsExtension.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2022 Microsoft Corporation - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - * - * Contributors: - * Microsoft Corporation - initial API and implementation - * - */ - -package org.eclipse.edc.plugins.edcbuild.extensions; - -import org.gradle.api.provider.Property; - -public abstract class VersionsExtension { - private String catalogName = "libs"; - - public abstract Property getProjectVersion(); - - public abstract Property getJetbrainsAnnotation(); - - public abstract Property getJackson(); - - public abstract Property getMetaModel(); - - public abstract Property getJupiter(); - - public abstract Property getMockito(); - - public abstract Property getAssertJ(); - - public String getCatalogName() { - return catalogName; - } - - public void setCatalogName(String catalogName) { - this.catalogName = catalogName; - } - -}