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
36 changes: 30 additions & 6 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 @@ -356,12 +358,12 @@ under the License.
<artifactId>maven-it-plugin-plexus-lifecycle</artifactId>
<version>${core-it-support-version}</version>
</dependency>
<dependency>
<groupId>commons-jxpath</groupId>
<artifactId>commons-jxpath</artifactId>
<version>1.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-jxpath</groupId>
<artifactId>commons-jxpath</artifactId>
<version>1.4.0</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -381,6 +383,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 @@ -392,6 +404,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 @@ -403,6 +420,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 @@ -18,16 +18,18 @@
*/
package org.apache.maven.it;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.eclipse.jetty.security.ConstraintMapping;
import org.eclipse.jetty.security.ConstraintSecurityHandler;
import org.eclipse.jetty.security.HashLoginService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.nio.file.attribute.FileTime;
import java.security.DigestInputStream;
import java.security.MessageDigest;

import org.codehaus.plexus.util.FileUtils;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.nio.file.Path;
import java.util.List;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.nio.file.Path;
import java.util.List;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand All @@ -38,16 +39,15 @@ public void testit0063() throws Exception {
Verifier verifier = newVerifier(testDir);
verifier.setAutoclean(false);
verifier.deleteDirectory("target");
verifier.getSystemProperties().setProperty("jre.home", testDir.resolve("jdk/jre").toString());
verifier.getSystemProperties()
.setProperty("jre.home", testDir.resolve("jdk/jre").toString());
verifier.addCliArgument(
"org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:2.1-SNAPSHOT:compile");
verifier.execute();
verifier.verifyErrorFreeLog();

List<String> lines = verifier.loadLines("target/compile.txt");
assertEquals(2, lines.size());
ItUtils.assertCanonicalFileEquals(
testDir.resolve("jdk/lib/tools.jar"),
Path.of((String) lines.get(1)));
ItUtils.assertCanonicalFileEquals(testDir.resolve("jdk/lib/tools.jar"), Path.of((String) lines.get(1)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -93,9 +94,7 @@ public void testSnapshotUpdated() throws Exception {
@Test
public void testSnapshotUpdatedWithMetadata() throws Exception {
Path metadata = repository.resolve("org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml");
Files.writeString(
metadata,
constructMetadata("1", System.currentTimeMillis() - TIME_OFFSET, true));
Files.writeString(metadata, constructMetadata("1", System.currentTimeMillis() - TIME_OFFSET, true));

verifier.addCliArgument("package");
verifier.execute();
Expand All @@ -106,8 +105,7 @@ public void testSnapshotUpdatedWithMetadata() throws Exception {

Files.writeString(artifact, "updatedArtifact");
metadata = repository.resolve("org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml");
Files.writeString(
metadata, constructMetadata("2", System.currentTimeMillis(), true));
Files.writeString(metadata, constructMetadata("2", System.currentTimeMillis(), true));

verifier.addCliArgument("package");
verifier.execute();
Expand All @@ -126,9 +124,7 @@ public void testSnapshotUpdatedWithLocalMetadata() throws Exception {
Files.createDirectories(localMetadata.getParent());

Path metadata = repository.resolve("org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml");
Files.writeString(
metadata,
constructMetadata("1", System.currentTimeMillis() - TIME_OFFSET, true));
Files.writeString(metadata, constructMetadata("1", System.currentTimeMillis() - TIME_OFFSET, true));

verifier.addCliArgument("package");
verifier.execute();
Expand Down Expand Up @@ -157,8 +153,7 @@ public void testSnapshotUpdatedWithLocalMetadata() throws Exception {
Files.writeString(
localMetadata,
constructLocalMetadata("org.apache.maven", "maven-core-it-support", cal.getTimeInMillis(), true));
Files.writeString(
metadata, constructMetadata("2", System.currentTimeMillis() - 2000, true));
Files.writeString(metadata, constructMetadata("2", System.currentTimeMillis() - 2000, true));
Files.setLastModifiedTime(artifact, FileTime.fromMillis(System.currentTimeMillis()));

verifier.addCliArgument("package");
Expand All @@ -172,9 +167,7 @@ public void testSnapshotUpdatedWithLocalMetadata() throws Exception {
@Test
public void testSnapshotUpdatedWithMetadataUsingFileTimestamp() throws Exception {
Path metadata = repository.resolve("org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml");
Files.writeString(
metadata,
constructMetadata("1", System.currentTimeMillis() - TIME_OFFSET, false));
Files.writeString(metadata, constructMetadata("1", System.currentTimeMillis() - TIME_OFFSET, false));
Files.setLastModifiedTime(metadata, FileTime.fromMillis(System.currentTimeMillis() - TIME_OFFSET));

verifier.addCliArgument("package");
Expand All @@ -186,8 +179,7 @@ public void testSnapshotUpdatedWithMetadataUsingFileTimestamp() throws Exception

Files.writeString(artifact, "updatedArtifact");
metadata = repository.resolve("org/apache/maven/maven-core-it-support/1.0-SNAPSHOT/maven-metadata.xml");
Files.writeString(
metadata, constructMetadata("2", System.currentTimeMillis(), false));
Files.writeString(metadata, constructMetadata("2", System.currentTimeMillis(), false));

verifier.addCliArgument("package");
verifier.execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.nio.file.Path;
import java.util.Properties;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.nio.file.Path;
import java.util.Properties;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.net.InetAddress;
import java.nio.file.Path;
import java.util.Map;

import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.NetworkConnector;
import org.eclipse.jetty.server.Server;
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.nio.file.Path;

import org.junit.jupiter.api.Test;

public class MavenIT0199CyclicImportScopeTest extends AbstractMavenIntegrationTestCase {
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 @@ -100,8 +99,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 @@ -19,12 +19,12 @@
package org.apache.maven.it;

import java.nio.file.Path;

import org.junit.jupiter.api.Test;

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 @@ -21,6 +21,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;

import org.junit.Assert;
import org.junit.jupiter.api.Test;

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.nio.file.Path;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledForJreRange;
import org.junit.jupiter.api.condition.JRE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class MavenITgh10937QuotedPipesInMavenOptsTest extends AbstractMavenIntegrationT
*/
@Test
void testIt() throws Exception {
Path basedir =
extractResources("gh-10937-pipes-maven-opts");
Path basedir = extractResources("gh-10937-pipes-maven-opts");

Verifier verifier = newVerifier(basedir);
verifier.setEnvironmentVariable("MAVEN_OPTS", "-Dprop.maven-opts=\"foo|bar\"");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.nio.file.Path;
import java.util.List;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class MavenITgh11181CoreExtensionsMetaVersionsTest extends AbstractMavenIntegrat
*/
@Test
void pwMetaVersionIsInvalid() throws Exception {
Path testDir = extractResources("gh-11181-core-extensions-meta-versions")
.resolve("pw-metaversion-is-invalid");
Path testDir =
extractResources("gh-11181-core-extensions-meta-versions").resolve("pw-metaversion-is-invalid");
Verifier verifier = newVerifier(testDir);
verifier.setUserHomeDirectory(testDir.resolve("HOME"));
verifier.setAutoclean(false);
Expand All @@ -55,8 +55,8 @@ void pwMetaVersionIsInvalid() throws Exception {
*/
@Test
void uwMetaVersionIsValid() throws Exception {
Path testDir = extractResources("gh-11181-core-extensions-meta-versions")
.resolve("uw-metaversion-is-valid");
Path testDir =
extractResources("gh-11181-core-extensions-meta-versions").resolve("uw-metaversion-is-valid");
Verifier verifier = newVerifier(testDir);
verifier.setUserHomeDirectory(testDir.resolve("HOME"));
verifier.setHandleLocalRepoTail(false);
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.nio.file.Path;

import org.junit.jupiter.api.Test;

/**
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.nio.file.Path;

import org.junit.jupiter.api.Test;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.nio.file.Path;
import java.util.List;

import org.apache.maven.api.Constants;
import org.junit.jupiter.api.Test;

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.nio.file.Path;

import org.junit.jupiter.api.Test;

/**
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.nio.file.Path;

import org.junit.jupiter.api.Test;

/**
Expand Down Expand Up @@ -57,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 @@ -19,6 +19,7 @@
package org.apache.maven.it;

import java.nio.file.Path;

import org.junit.jupiter.api.Test;

/**
Expand Down Expand Up @@ -57,4 +58,3 @@ void testFlattenPluginWithParentExpansionDoesNotCauseCycle() throws Exception {
verifier.verifyFilePresent("target/.flattened-pom.xml");
}
}

Loading
Loading