From f84c8c4587986f7dc212be53c6997dd8f6867399 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Thu, 24 Apr 2025 18:18:14 +0200 Subject: [PATCH] [MNG-8572] Support DI beans in build extensions This commit adds support for using the Maven API DI system in build extensions (plugins with extensions=true). It enables build extensions to provide custom artifact type handlers using the new DI mechanism. Key changes: - Added an integration test that demonstrates a custom artifact type handler using the Maven API DI system in a build extension - The test shows how to implement a TypeProvider using @Named annotation - The annotation processor automatically generates the DI index file - The custom type handler is properly discovered and used during the build This enhancement allows build extensions to leverage the new Maven API DI system, making it easier to create and maintain extensions that provide custom artifact type handlers. --- .../internal/impl/DefaultTypeRegistry.java | 21 ++--- .../internal/DefaultMavenPluginManager.java | 5 +- .../it/MavenITmng8572DITypeHandlerTest.java | 59 ++++++++++++ .../apache/maven/it/TestSuiteOrdering.java | 1 + .../mng-8572-di-type-handler/README.md | 57 ++++++++++++ .../extension/pom.xml | 93 +++++++++++++++++++ .../its/mng8572/extension/CustomType.java | 87 +++++++++++++++++ .../mng8572/extension/CustomTypeProvider.java | 57 ++++++++++++ .../maven/its/mng8572/extension/NoOpMojo.java | 46 +++++++++ .../test/dummy-artifact-pom.xml | 12 +++ .../test/install-dummy.sh | 7 ++ .../mng-8572-di-type-handler/test/pom.xml | 81 ++++++++++++++++ .../test/settings.xml | 5 + .../maven/its/mng8572/test/DummyClass.java | 28 ++++++ 14 files changed, 547 insertions(+), 12 deletions(-) create mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8572DITypeHandlerTest.java create mode 100644 its/core-it-suite/src/test/resources/mng-8572-di-type-handler/README.md create mode 100644 its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/src/main/java/org/apache/maven/its/mng8572/extension/CustomType.java create mode 100644 its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/src/main/java/org/apache/maven/its/mng8572/extension/CustomTypeProvider.java create mode 100644 its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/src/main/java/org/apache/maven/its/mng8572/extension/NoOpMojo.java create mode 100644 its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/dummy-artifact-pom.xml create mode 100755 its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/install-dummy.sh create mode 100644 its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/settings.xml create mode 100644 its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/src/main/java/org/apache/maven/its/mng8572/test/DummyClass.java diff --git a/impl/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultTypeRegistry.java b/impl/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultTypeRegistry.java index 9431ec3a7669..2ec2dc248034 100644 --- a/impl/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultTypeRegistry.java +++ b/impl/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultTypeRegistry.java @@ -22,16 +22,15 @@ import javax.inject.Named; import javax.inject.Singleton; -import java.util.List; -import java.util.Map; +import java.util.Objects; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; -import java.util.stream.Collectors; import org.apache.maven.api.JavaPathType; import org.apache.maven.api.Type; import org.apache.maven.api.annotations.Nonnull; import org.apache.maven.api.services.LanguageRegistry; +import org.apache.maven.api.services.Lookup; import org.apache.maven.api.services.TypeRegistry; import org.apache.maven.api.spi.TypeProvider; import org.apache.maven.artifact.handler.ArtifactHandler; @@ -41,12 +40,11 @@ import org.apache.maven.impl.resolver.type.DefaultType; import static java.util.Objects.requireNonNull; -import static java.util.function.Function.identity; @Named @Singleton public class DefaultTypeRegistry extends AbstractEventSpy implements TypeRegistry { - private final Map types; + private final Lookup lookup; private final LanguageRegistry languageRegistry; @@ -55,11 +53,8 @@ public class DefaultTypeRegistry extends AbstractEventSpy implements TypeRegistr private final LegacyArtifactHandlerManager manager; @Inject - public DefaultTypeRegistry( - List providers, LanguageRegistry languageRegistry, LegacyArtifactHandlerManager manager) { - this.types = requireNonNull(providers, "providers cannot be null").stream() - .flatMap(p -> p.provides().stream()) - .collect(Collectors.toMap(Type::id, identity())); + public DefaultTypeRegistry(Lookup lookup, LanguageRegistry languageRegistry, LegacyArtifactHandlerManager manager) { + this.lookup = lookup; this.languageRegistry = requireNonNull(languageRegistry, "languageRegistry cannot be null"); this.usedTypes = new ConcurrentHashMap<>(); this.manager = requireNonNull(manager, "artifactHandlerManager cannot be null"); @@ -84,7 +79,11 @@ public Optional lookup(String id) { public Type require(String id) { requireNonNull(id, "id cannot be null"); return usedTypes.computeIfAbsent(id, i -> { - Type type = types.get(id); + Type type = lookup.lookupList(TypeProvider.class).stream() + .flatMap(p -> p.provides().stream()) + .filter(t -> Objects.equals(id, t.id())) + .findFirst() + .orElse(null); if (type == null) { // Copy data as the ArtifactHandler is not immutable, but Type should be. ArtifactHandler handler = manager.getArtifactHandler(id); diff --git a/impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java b/impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java index 1f969db53072..69b9f4466fa3 100644 --- a/impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java +++ b/impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java @@ -63,6 +63,7 @@ import org.apache.maven.internal.impl.DefaultLog; import org.apache.maven.internal.impl.DefaultMojoExecution; import org.apache.maven.internal.impl.InternalMavenSession; +import org.apache.maven.internal.impl.SisuDiBridgeModule; import org.apache.maven.internal.xml.XmlPlexusConfiguration; import org.apache.maven.model.Plugin; import org.apache.maven.plugin.ContextEnabled; @@ -440,12 +441,14 @@ private void discoverPluginComponents( } } + Thread.currentThread().setContextClassLoader(pluginRealm); ((DefaultPlexusContainer) container) .discoverComponents( pluginRealm, new SessionScopeModule(container.lookup(SessionScope.class)), new MojoExecutionScopeModule(container.lookup(MojoExecutionScope.class)), - new PluginConfigurationModule(plugin.getDelegate())); + new PluginConfigurationModule(plugin.getDelegate()), + new SisuDiBridgeModule(true)); } catch (ComponentLookupException | CycleDetectedInComponentGraphException e) { throw new PluginContainerException( plugin, diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8572DITypeHandlerTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8572DITypeHandlerTest.java new file mode 100644 index 000000000000..d1d6db0b7e18 --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8572DITypeHandlerTest.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.it; + +import java.io.File; + +import org.junit.jupiter.api.Test; + +/** + * This is a test set for MNG-8572. + * + * It verifies that Maven plugins with extensions=true can provide custom artifact type handlers using the Maven API DI system. + */ +public class MavenITmng8572DITypeHandlerTest extends AbstractMavenIntegrationTestCase { + + public MavenITmng8572DITypeHandlerTest() { + super("[4.0.0-rc-4,)"); + } + + @Test + public void testCustomTypeHandler() throws Exception { + // Build the extension first + File testDir = extractResources("/mng-8572-di-type-handler"); + Verifier verifier = newVerifier(new File(testDir, "extension").getAbsolutePath()); + verifier.setAutoclean(false); + verifier.deleteDirectory("target"); + verifier.deleteArtifacts("org.apache.maven.its.mng8572"); + verifier.addCliArgument("install"); + verifier.execute(); + verifier.verifyErrorFreeLog(); + + // Now use the extension in a test project + verifier = newVerifier(new File(testDir, "test").getAbsolutePath()); + verifier.setAutoclean(false); + verifier.deleteDirectory("target"); + verifier.addCliArgument("validate"); + verifier.execute(); + verifier.verifyErrorFreeLog(); + + // Verify that our custom type handler was used + verifier.verifyTextInLog("[INFO] Using custom type handler for type: custom-type"); + } +} diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java b/its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java index 425a4db23a20..e8b651f49fa8 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java @@ -101,6 +101,7 @@ public TestSuiteOrdering() { * the tests are to finishing. Newer tests are also more likely to fail, so this is * a fail fast technique as well. */ + suite.addTestSuite(MavenITmng8572DITypeHandlerTest.class); suite.addTestSuite(MavenITmng3558PropertyEscapingTest.class); suite.addTestSuite(MavenITmng4559MultipleJvmArgsTest.class); suite.addTestSuite(MavenITmng4559SpacesInJvmOptsTest.class); diff --git a/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/README.md b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/README.md new file mode 100644 index 000000000000..db7e3d6cd1b9 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/README.md @@ -0,0 +1,57 @@ +# MNG-8572 Custom Type Handler with Maven API DI + +This integration test demonstrates how to create a Maven plugin with `extensions=true` that provides a custom artifact type handler using the Maven API DI system. + +## Structure + +- `extension/`: The Maven plugin with extensions=true that provides a custom artifact type handler + - Uses `org.apache.maven.api.di.Named` annotation + - Implements `org.apache.maven.api.spi.TypeProvider` interface + - Provides a custom type with ID "custom-type" + - Uses the Maven API DI system for component discovery + - The annotation processor automatically generates the DI index + +- `test/`: A test project that uses the custom type handler + - References the plugin in the build section with `true` + - Has a dependency with `type="custom-type"` + - Verifies that the custom type handler is used + +## Key Points + +1. **Maven Plugin with extensions=true**: + - The plugin is configured with `true` + - This allows it to participate in the build process and provide custom components + +2. **TypeProvider Implementation**: + - Implements the `org.apache.maven.api.spi.TypeProvider` interface + - Annotated with `@Named` from `org.apache.maven.api.di` + - Returns a custom implementation of the `Type` interface + +3. **Annotation Processing**: + - The Maven API DI annotation processor automatically generates the index file + - No need to manually create the `META-INF/maven/org.apache.maven.api.di.Inject` file + +## Running the Test + +1. Build and install the plugin: + ``` + cd extension + mvn install + ``` + +2. Install the dummy artifact: + ``` + cd test + ./install-dummy.sh + ``` + +3. Run the test project: + ``` + cd test + mvn validate + ``` + +4. Verify that the custom type handler is used: + ``` + [INFO] Using custom type handler for type: custom-type + ``` diff --git a/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/pom.xml b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/pom.xml new file mode 100644 index 000000000000..3a95d69b9ccd --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/pom.xml @@ -0,0 +1,93 @@ + + + + 4.1.0 + + org.apache.maven.its.mng8572 + custom-type-maven-plugin + 1.0-SNAPSHOT + maven-plugin + + MNG-8572 Custom Type Handler Maven Plugin + Maven plugin with extensions=true that provides a custom artifact type handler using Maven API DI + + + UTF-8 + 17 + 17 + + + + + + org.apache.maven + maven-api-core + 4.0.0-rc-3 + provided + + + org.apache.maven + maven-api-di + 4.0.0-rc-3 + provided + + + org.apache.maven + maven-api-spi + 4.0.0-rc-3 + provided + + + org.slf4j + slf4j-api + 2.0.16 + provided + + + + + + + + org.apache.maven.plugins + maven-plugin-plugin + 4.0.0-beta-1 + true + + true + + java-annotations + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.14.0 + + 17 + full + + + + + diff --git a/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/src/main/java/org/apache/maven/its/mng8572/extension/CustomType.java b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/src/main/java/org/apache/maven/its/mng8572/extension/CustomType.java new file mode 100644 index 000000000000..2709ae4e5ba5 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/src/main/java/org/apache/maven/its/mng8572/extension/CustomType.java @@ -0,0 +1,87 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.its.mng8572.extension; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +import org.apache.maven.api.Language; +import org.apache.maven.api.PathType; +import org.apache.maven.api.Type; + +/** + * Implementation of a custom artifact type. + */ +public class CustomType implements Type { + + private final String id; + private final Language language; + private final String extension; + private final String classifier; + private final boolean includesDependencies; + private final Set pathTypes; + + public CustomType( + String id, + Language language, + String extension, + String classifier, + boolean includesDependencies, + PathType... pathTypes) { + this.id = Objects.requireNonNull(id, "id cannot be null"); + this.language = Objects.requireNonNull(language, "language cannot be null"); + this.extension = Objects.requireNonNull(extension, "extension cannot be null"); + this.classifier = classifier; + this.includesDependencies = includesDependencies; + this.pathTypes = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(pathTypes))); + } + + @Override + public String id() { + return id; + } + + @Override + public Language getLanguage() { + return language; + } + + @Override + public String getExtension() { + return extension; + } + + @Override + public String getClassifier() { + return classifier; + } + + @Override + public boolean isIncludesDependencies() { + return includesDependencies; + } + + @Override + public Set getPathTypes() { + return pathTypes; + } +} diff --git a/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/src/main/java/org/apache/maven/its/mng8572/extension/CustomTypeProvider.java b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/src/main/java/org/apache/maven/its/mng8572/extension/CustomTypeProvider.java new file mode 100644 index 000000000000..eb96a51a20a7 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/src/main/java/org/apache/maven/its/mng8572/extension/CustomTypeProvider.java @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.its.mng8572.extension; + +import java.util.Collection; +import java.util.Collections; + +import org.apache.maven.api.JavaPathType; +import org.apache.maven.api.Language; +import org.apache.maven.api.Type; +import org.apache.maven.api.di.Named; +import org.apache.maven.api.spi.TypeProvider; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Provides a custom artifact type handler using the Maven API DI system. + */ +@Named +public class CustomTypeProvider implements TypeProvider { + + private static final Logger LOGGER = LoggerFactory.getLogger(CustomTypeProvider.class); + + @Override + public Collection provides() { + System.out.println("[MNG-8572] Registering custom type handler for type: custom-type"); + LOGGER.info("[MNG-8572] Registering custom type handler for type: custom-type"); + + // Create a custom type that will be used for dependencies with type="custom-type" + CustomType customType = new CustomType( + "custom-type", // type id + Language.JAVA_FAMILY, // language + "custom", // extension + null, // classifier + false, // includesDependencies + JavaPathType.CLASSES // pathTypes - add to classpath + ); + + return Collections.singleton(customType); + } +} diff --git a/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/src/main/java/org/apache/maven/its/mng8572/extension/NoOpMojo.java b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/src/main/java/org/apache/maven/its/mng8572/extension/NoOpMojo.java new file mode 100644 index 000000000000..fa08a3ba0c5d --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/extension/src/main/java/org/apache/maven/its/mng8572/extension/NoOpMojo.java @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.its.mng8572.extension; + +import org.apache.maven.api.di.Inject; +import org.apache.maven.api.plugin.Log; +import org.apache.maven.api.plugin.Mojo; +import org.apache.maven.api.plugin.annotations.Parameter; + +/** + * A no-operation Mojo that does nothing. This is just to make the plugin valid. + * The real functionality is in the TypeProvider. + * + * @goal noop + */ +@org.apache.maven.api.plugin.annotations.Mojo(name = "noop") +public class NoOpMojo implements Mojo { + + @Inject + private Log log; + + @Parameter(defaultValue = "${project.name}", readonly = true) + private String projectName; + + @Override + public void execute() { + log.info("NoOpMojo executed for project: " + projectName); + log.info("This Mojo does nothing. The real functionality is in the TypeProvider."); + } +} diff --git a/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/dummy-artifact-pom.xml b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/dummy-artifact-pom.xml new file mode 100644 index 000000000000..4bd7ecdad4a4 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/dummy-artifact-pom.xml @@ -0,0 +1,12 @@ + + + 4.1.0 + + org.apache.maven.its.mng8572 + dummy-artifact + 1.0-SNAPSHOT + custom-type + + MNG-8572 Dummy Artifact + Dummy artifact with custom type + diff --git a/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/install-dummy.sh b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/install-dummy.sh new file mode 100755 index 000000000000..3d74307d5922 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/install-dummy.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Install the dummy artifact with our custom type +mvn install:install-file \ + -Dfile=src/main/java/org/apache/maven/its/mng8572/test/DummyClass.java \ + -DpomFile=dummy-artifact-pom.xml \ + -Dpackaging=custom-type \ + -DcreateChecksum=true diff --git a/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/pom.xml b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/pom.xml new file mode 100644 index 000000000000..c7332659aea8 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/pom.xml @@ -0,0 +1,81 @@ + + + + 4.1.0 + + org.apache.maven.its.mng8572 + test + 1.0-SNAPSHOT + jar + + MNG-8572 Custom Type Handler Test + Test project that uses a custom artifact type handler + + + UTF-8 + 17 + 17 + + + + + + org.apache.maven.its.mng8572 + dummy-artifact + 1.0-SNAPSHOT + custom-type + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.13.0 + + 17 + + + + + org.apache.maven.its.mng8572 + custom-type-maven-plugin + 1.0-SNAPSHOT + true + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.6.1 + + + list + + list + + validate + + + + + + diff --git a/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/settings.xml b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/settings.xml new file mode 100644 index 000000000000..a28073f1427c --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/settings.xml @@ -0,0 +1,5 @@ + + + ${basedir}/target/local-repo + false + diff --git a/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/src/main/java/org/apache/maven/its/mng8572/test/DummyClass.java b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/src/main/java/org/apache/maven/its/mng8572/test/DummyClass.java new file mode 100644 index 000000000000..9be28a7c65cc --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-8572-di-type-handler/test/src/main/java/org/apache/maven/its/mng8572/test/DummyClass.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.its.mng8572.test; + +/** + * Dummy class for testing. + */ +public class DummyClass { + public static void main(String[] args) { + System.out.println("Hello from DummyClass"); + } +}