Skip to content
Open
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
24 changes: 24 additions & 0 deletions its/core-it-suite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ under the License.
<!-- Support artifacts version - kept separate from Maven version -->
<core-it-support-version>2.1-SNAPSHOT</core-it-support-version>

<version.palantirJavaFormat>2.90.0</version.palantirJavaFormat>
<version.maven-shared-resources>6</version.maven-shared-resources>
<its.forkCount>0.75C</its.forkCount>
<its.test />
</properties>
Expand Down Expand Up @@ -375,6 +377,16 @@ under the License.
<artifactId>spotless-maven-plugin</artifactId>
<configuration>
<java>
<palantirJavaFormat>
<version>${version.palantirJavaFormat}</version>
</palantirJavaFormat>
<removeUnusedImports />
<importOrder>
<file>config/maven-eclipse-importorder.txt</file>
</importOrder>
<licenseHeader>
<file>config/maven-header-plain.txt</file>
</licenseHeader>
<includes>
<include>src/main/java/**/*.java</include>
<include>src/test/java/**/*.java</include>
Expand All @@ -386,6 +398,11 @@ under the License.
</excludes>
</java>
<pom>
<sortPom>
<expandEmptyElements>false</expandEmptyElements>
<spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
<quiet>true</quiet>
</sortPom>
<includes>
<include>pom.xml</include>
<include>src/test/resources/**/pom.xml</include>
Expand All @@ -397,6 +414,13 @@ under the License.
</excludes>
</pom>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-resources</artifactId>
<version>${version.maven-shared-resources}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.apache.maven.model.v4.MavenStaxReader;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down Expand Up @@ -102,8 +101,8 @@ void testConsumerPomWithBomFromSettingsProfileRepo() throws Exception {
&& "2.0".equals(d.getVersion()));
assertTrue(
hasLibA,
"Consumer POM should contain lib-a with version 2.0 resolved from the BOM. "
+ "Actual dependencies: " + consumerPomModel.getDependencies());
"Consumer POM should contain lib-a with version 2.0 resolved from the BOM. " + "Actual dependencies: "
+ consumerPomModel.getDependencies());

// The BOM import should NOT appear in the consumer POM (it's been flattened)
if (consumerPomModel.getDependencyManagement() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

public class MavenITMissingNamespaceTest extends AbstractMavenIntegrationTestCase {

public MavenITMissingNamespaceTest() {
}
public MavenITMissingNamespaceTest() {}

/**
* Test when project element does not have an xmlns attribute.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.maven.it;

import java.io.File;

import org.junit.jupiter.api.Test;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ void testRelativeTargetPathInResources() throws Exception {
verifier.verifyFileNotPresent("target-dir/subdir/another.yml");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@ void testIt() throws Exception {
verifier.verifyTextInLog("<url>https://github.com/slackapi/java-slack-sdk</url>");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ void testFlattenPluginWithParentExpansionDoesNotCauseCycle() throws Exception {
verifier.verifyFilePresent("target/.flattened-pom.xml");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,3 @@ void testProfileSourceInMultiModuleProject() throws Exception {
verifier.verifyTextInLog("child-profile (source: test.gh11409:subproject:1.0-SNAPSHOT)");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,16 @@ class MavenITgh11427BomConsumerPomTest extends AbstractMavenIntegrationTestCase
*/
@Test
void testBomConsumerPomWithoutFlatten() throws Exception {
Path basedir = extractResources("/gh-11427-bom-consumer-pom")
.getAbsoluteFile()
.toPath();
Path basedir =
extractResources("/gh-11427-bom-consumer-pom").getAbsoluteFile().toPath();

Verifier verifier = newVerifier(basedir.toString());
verifier.addCliArguments("install");
verifier.execute();
verifier.verifyErrorFreeLog();

Path consumerPomPath = Paths.get(
verifier.getArtifactPath("org.apache.maven.its.gh-11427", "bom", "1.0.0-SNAPSHOT", "pom"));
Path consumerPomPath =
Paths.get(verifier.getArtifactPath("org.apache.maven.its.gh-11427", "bom", "1.0.0-SNAPSHOT", "pom"));

assertTrue(Files.exists(consumerPomPath), "consumer pom not found at " + consumerPomPath);

Expand Down Expand Up @@ -82,17 +81,16 @@ void testBomConsumerPomWithoutFlatten() throws Exception {
*/
@Test
void testBomConsumerPomWithFlatten() throws Exception {
Path basedir = extractResources("/gh-11427-bom-consumer-pom")
.getAbsoluteFile()
.toPath();
Path basedir =
extractResources("/gh-11427-bom-consumer-pom").getAbsoluteFile().toPath();

Verifier verifier = newVerifier(basedir.toString());
verifier.addCliArguments("install", "-Dmaven.consumer.pom.flatten=true");
verifier.execute();
verifier.verifyErrorFreeLog();

Path consumerPomPath = Paths.get(
verifier.getArtifactPath("org.apache.maven.its.gh-11427", "bom", "1.0.0-SNAPSHOT", "pom"));
Path consumerPomPath =
Paths.get(verifier.getArtifactPath("org.apache.maven.its.gh-11427", "bom", "1.0.0-SNAPSHOT", "pom"));

assertTrue(Files.exists(consumerPomPath), "consumer pom not found at " + consumerPomPath);

Expand Down Expand Up @@ -120,8 +118,6 @@ void testBomConsumerPomWithFlatten() throws Exception {
content.contains("<version>1.0.0-SNAPSHOT</version>") || content.contains("<version>${"),
"Consumer pom should have version for module dependency");
assertTrue(
content.contains("<version>4.13.2</version>"),
"Consumer pom should have version for junit dependency");
content.contains("<version>4.13.2</version>"), "Consumer pom should have version for junit dependency");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class MavenITgh11456MixinsConsumerPomTest extends AbstractMavenIntegrationTestCa
*/
@Test
void testMixinsWithoutFlattening() throws Exception {
Path basedir = extractResources("/gh-11456-mixins-consumer-pom/non-flattened").toPath();
Path basedir =
extractResources("/gh-11456-mixins-consumer-pom/non-flattened").toPath();

Verifier verifier = newVerifier(basedir.toString());
verifier.addCliArgument("-Dmaven.repo.local=" + basedir.resolve("repo"));
Expand All @@ -61,7 +62,8 @@ void testMixinsWithoutFlattening() throws Exception {
*/
@Test
void testMixinsWithFlattening() throws Exception {
Path basedir = extractResources("/gh-11456-mixins-consumer-pom/flattened").toPath();
Path basedir =
extractResources("/gh-11456-mixins-consumer-pom/flattened").toPath();

Verifier verifier = newVerifier(basedir.toString());
verifier.addCliArgument("-Dmaven.repo.local=" + basedir.resolve("repo").toString());
Expand Down Expand Up @@ -94,7 +96,8 @@ void testMixinsWithFlattening() throws Exception {
*/
@Test
void testMixinsWithPreserveModelVersion() throws Exception {
Path basedir = extractResources("/gh-11456-mixins-consumer-pom/preserve-model-version").toPath();
Path basedir = extractResources("/gh-11456-mixins-consumer-pom/preserve-model-version")
.toPath();

Verifier verifier = newVerifier(basedir.toString());
verifier.addCliArgument("-Dmaven.repo.local=" + basedir.resolve("repo").toString());
Expand Down Expand Up @@ -122,4 +125,3 @@ void testMixinsWithPreserveModelVersion() throws Exception {
"Mixins should be kept in consumer POM when preserveModelVersion is enabled");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,3 @@ public void testAtSignInCommandLineProperty() throws Exception {
"Command-line value with @ character should be preserved");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,21 @@ void testConsumerPomsAre400BuildPomsAre410() throws Exception {
verifier.verifyErrorFreeLog();

// Verify parent consumer POM (main artifact) is 4.0.0
Path parentConsumerPom =
Path.of(verifier.getArtifactPath(GROUP_ID, "parent", "1.0.0-SNAPSHOT", "pom"));
Path parentConsumerPom = Path.of(verifier.getArtifactPath(GROUP_ID, "parent", "1.0.0-SNAPSHOT", "pom"));
assertTrue(Files.exists(parentConsumerPom), "Parent consumer POM should exist");
Model parentConsumer = readModel(parentConsumerPom);
assertEquals("4.0.0", parentConsumer.getModelVersion(), "Parent consumer POM should be 4.0.0");

// Verify parent build POM retains 4.1.0 features
Path parentBuildPom =
Path.of(verifier.getArtifactPath(GROUP_ID, "parent", "1.0.0-SNAPSHOT", "pom", "build"));
Path parentBuildPom = Path.of(verifier.getArtifactPath(GROUP_ID, "parent", "1.0.0-SNAPSHOT", "pom", "build"));
assertTrue(Files.exists(parentBuildPom), "Parent build POM should exist");
Model parentBuild = readModel(parentBuildPom);
// Build POM should retain subprojects (4.1.0 feature)
assertNotNull(parentBuild.getSubprojects(), "Build POM should retain subprojects");
assertTrue(!parentBuild.getSubprojects().isEmpty(), "Build POM should retain subprojects");

// Verify child consumer POM is 4.0.0
Path childConsumerPom =
Path.of(verifier.getArtifactPath(GROUP_ID, "child", "1.0.0-SNAPSHOT", "pom"));
Path childConsumerPom = Path.of(verifier.getArtifactPath(GROUP_ID, "child", "1.0.0-SNAPSHOT", "pom"));
assertTrue(Files.exists(childConsumerPom), "Child consumer POM should exist");
Model childConsumer = readModel(childConsumerPom);
assertEquals("4.0.0", childConsumer.getModelVersion(), "Child consumer POM should be 4.0.0");
Expand All @@ -84,8 +81,7 @@ void testConsumerPomsAre400BuildPomsAre410() throws Exception {
assertEquals("parent", childConsumer.getParent().getArtifactId());

// Verify child build POM exists
Path childBuildPom =
Path.of(verifier.getArtifactPath(GROUP_ID, "child", "1.0.0-SNAPSHOT", "pom", "build"));
Path childBuildPom = Path.of(verifier.getArtifactPath(GROUP_ID, "child", "1.0.0-SNAPSHOT", "pom", "build"));
assertTrue(Files.exists(childBuildPom), "Child build POM should exist");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class MavenITgh11798ConsumerPomProfileActivationTest extends AbstractMavenIntegr

@Test
void testConsumerPomResolvesParentProfileProperties() throws Exception {
Path basedir = extractResources("/gh-11798-consumer-pom-profile-activation").toPath();
Path basedir =
extractResources("/gh-11798-consumer-pom-profile-activation").toPath();

Verifier verifier = newVerifier(basedir.toString());
verifier.addCliArgument("install");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.maven.it;

import java.io.File;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertThrows;
Expand All @@ -40,7 +41,8 @@ void testItrNotHonored() throws Exception {
verifier.deleteArtifacts("org.apache.maven.its.gh2576");

verifier = new Verifier(new File(testDir, "parent").toString());
verifier.addCliArguments("install:install-file", "-Dfile=pom.xml", "-DpomFile=pom.xml", "-DlocalRepositoryPath=../repo/");
verifier.addCliArguments(
"install:install-file", "-Dfile=pom.xml", "-DpomFile=pom.xml", "-DlocalRepositoryPath=../repo/");
verifier.execute();
verifier.verifyErrorFreeLog();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.Comparator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.junit.jupiter.api.ClassDescriptor;
import org.junit.jupiter.api.ClassOrderer;
import org.junit.jupiter.api.ClassOrdererContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
import org.apache.maven.api.di.Priority;
import org.apache.maven.api.di.Provides;
import org.apache.maven.api.di.Singleton;
import org.apache.maven.testing.plugin.stubs.SessionMock;
import org.apache.maven.api.services.DependencyResolver;
import org.apache.maven.api.services.OsService;
import org.apache.maven.api.services.ToolchainManager;
import org.apache.maven.impl.DefaultToolchainManager;
import org.apache.maven.impl.InternalSession;
import org.apache.maven.impl.model.DefaultOsService;
import org.apache.maven.testing.plugin.stubs.SessionMock;
import org.mockito.Mockito;

import static org.apache.maven.testing.plugin.MojoExtension.getBasedir;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.maven.its.gh11314</groupId>
<artifactId>test-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>consumer</artifactId>
<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
*/
package org.apache.maven.its.gh11314;

import java.util.Map;
import javax.inject.Inject;
import javax.inject.Named;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.toolchain.ToolchainFactory;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<modules>
<module>plugin</module>
<module>consumer</module>
</modules>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.1.0" root="true">

<groupId>org.apache.maven.reproducer</groupId>
<artifactId>reproducer-debezium</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<groupId>org.apache.maven.reproducer</groupId>
<artifactId>reproducer-debezium</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<debezium-version>3.3.1.Final</debezium-version>
</properties>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<debezium-version>3.3.1.Final</debezium-version>
</properties>

<dependencies>
<dependency>
<groupId>io.debezium</groupId>
<artifactId>debezium-connector-db2</artifactId>
<version>${debezium-version}</version>
</dependency>
</dependencies>
</project>
<dependencies>
<dependency>
<groupId>io.debezium</groupId>
<artifactId>debezium-connector-db2</artifactId>
<version>${debezium-version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<modules>
<module>plugin</module>
<module>consumer</module>
</modules>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
Loading
Loading