Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<extension>
<groupId>me.qoomon</groupId>
<artifactId>maven-git-versioning-extension</artifactId>
<version>9.6.4</version>
<version>9.6.5</version>
</extension>
</extensions>
2 changes: 1 addition & 1 deletion boms-parent/maven-plugin-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>3.3.0</version>
<version>4.0.0-alpha-1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
54 changes: 44 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>pl.wavesoftware.sampler</groupId>
<artifactId>sampler-spring</artifactId>
<version>1.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -291,7 +297,7 @@
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<version>3.5.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -303,7 +309,7 @@
</plugin>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -316,28 +322,52 @@
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<version>3.3.0</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
<version>3.12.1</version>
</plugin>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.0</version>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<version>2.1</version>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>${maven.version}</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.15.0</version>
</plugin>
<plugin>
<groupId>me.qoomon</groupId>
<artifactId>maven-git-versioning-extension</artifactId>
<version>9.6.5</version>
</plugin>
</plugins>
</pluginManagement>
Expand All @@ -347,6 +377,10 @@
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
Expand Down
2 changes: 1 addition & 1 deletion tools/plugs-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<name>Plugs :: Tools :: Plugs Maven Plugin</name>

<prerequisites>
<maven>3.3</maven>
<maven>3.8.8</maven>
</prerequisites>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,19 @@
import org.apache.maven.project.ProjectBuilder;
import org.apache.maven.project.ProjectBuildingRequest;
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
import org.apache.maven.settings.MavenSettingsBuilder;
import org.apache.maven.settings.Settings;
import org.apache.maven.settings.building.DefaultSettingsBuildingRequest;
import org.apache.maven.settings.building.SettingsBuilder;
import org.apache.maven.settings.building.SettingsBuildingException;
import org.apache.maven.settings.building.SettingsBuildingResult;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pl.wavesoftware.eid.utils.EidPreconditions;

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Collections;
import java.util.Optional;
Expand All @@ -51,6 +55,8 @@
*/
final class DefaultMojoConfigurator implements MojoConfigurator {

private static final Logger LOGGER = LoggerFactory.getLogger(DefaultMojoConfigurator.class);

private final Supplier<Optional<MavenProjectCustomizer>> customizer;

DefaultMojoConfigurator(Supplier<Optional<MavenProjectCustomizer>> customizer) {
Expand Down Expand Up @@ -80,15 +86,22 @@ public MojoExecution getMojoExecution(MojoRule rule, String goal) {
}

private MavenExecutionRequest createMavenExecutionRequest(MojoRule rule)
throws ComponentLookupException, IOException,
XmlPullParserException, MavenExecutionRequestPopulationException {
throws ComponentLookupException, MavenExecutionRequestPopulationException,
SettingsBuildingException {

PlexusContainer container = rule.getContainer();
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
MavenExecutionRequestPopulator requestPopulator =
container.lookup(MavenExecutionRequestPopulator.class);
MavenSettingsBuilder settingsBuilder = container.lookup(MavenSettingsBuilder.class);
Settings settings = settingsBuilder.buildSettings();
SettingsBuilder settingsBuilder = container.lookup(SettingsBuilder.class);
SettingsBuildingResult sbr = settingsBuilder.build(
new DefaultSettingsBuildingRequest()
);
sbr.getProblems().forEach(problem ->
LOGGER.error(problem.getMessage(), problem.getException())
);
EidPreconditions.checkState(sbr.getProblems().isEmpty(), "20230320:004212");
Settings settings = sbr.getEffectiveSettings();
requestPopulator.populateFromSettings(request, settings);
requestPopulator.populateDefaults(request);
return request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@
import org.junit.jupiter.api.extension.ParameterContext;
import org.junit.jupiter.api.extension.ParameterResolutionException;
import org.junit.jupiter.api.extension.ParameterResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* @author <a href="mailto:krzysztof.suszynski@wavesoftware.pl">Krzysztof Suszynski</a>
* @since 0.1.0
*/
public final class MavenInvokerExtension implements ParameterResolver {

private static final Logger LOGGER = LoggerFactory.getLogger(MavenInvokerExtension.class);

@Override
public boolean supportsParameter(
ParameterContext parameterContext,
Expand All @@ -45,6 +49,7 @@ public Object resolveParameter(
) throws ParameterResolutionException {
return (MavenInvoker) pomDirectory -> goals -> {
MavenCli cli = new MavenCli();
LOGGER.info("Invoking Maven {} in {}", goals, pomDirectory);
System.setProperty(
MavenCli.MULTIMODULE_PROJECT_DIRECTORY, pomDirectory.toString()
);
Expand Down
21 changes: 16 additions & 5 deletions tools/plugs-maven-plugin/src/test/resources/code-with-deps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-parent</artifactId>
<version>2.1.5.RELEASE</version>
<artifactId>spring-boot-dependencies</artifactId>
<version>3.0.4</version>
<relativePath />
</parent>
<groupId>org.example</groupId>
Expand All @@ -29,7 +29,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
</properties>

Expand All @@ -42,7 +42,7 @@
<dependency>
<groupId>org.apiguardian</groupId>
<artifactId>apiguardian-api</artifactId>
<version>1.0.0</version>
<version>1.1.2</version>
</dependency>

<dependency>
Expand All @@ -54,7 +54,7 @@
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
<version>7.0.0</version>
<version>8.0.0</version>
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -84,4 +84,15 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
2 changes: 1 addition & 1 deletion tools/plugs-packager-samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<dependency>
<groupId>pl.wavesoftware.sampler</groupId>
<artifactId>sampler-spring</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.jimfs</groupId>
Expand Down