[MNG-8123] IT for build cache extension (#342)

This commit is contained in:
Guillaume Nodet 2024-05-22 15:45:02 +02:00 committed by GitHub
parent c959b7ebe7
commit ff1d119179
6 changed files with 132 additions and 0 deletions

View File

@ -0,0 +1,41 @@
/*
* 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.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test;
public class MavenITmng8123BuildCacheTest extends AbstractMavenIntegrationTestCase {
public MavenITmng8123BuildCacheTest() {
super("[3,)");
}
@Test
public void testBuildCacheExtension() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-8123-build-cache");
Verifier verifier = newVerifier(testDir.getAbsolutePath());
verifier.addCliArgument("install");
verifier.execute();
verifier.verifyErrorFreeLog();
}
}

View File

@ -120,6 +120,7 @@ public class TestSuiteOrdering implements ClassOrderer {
* the tests are to finishing. Newer tests are also more likely to fail, so this is * the tests are to finishing. Newer tests are also more likely to fail, so this is
* a fail fast technique as well. * a fail fast technique as well.
*/ */
suite.addTestSuite(MavenITmng8123BuildCacheTest.class);
suite.addTestSuite(MavenITmng8106OverlappingDirectoryRolesTest.class); suite.addTestSuite(MavenITmng8106OverlappingDirectoryRolesTest.class);
suite.addTestSuite(MavenITmng8005IdeWorkspaceReaderUsedTest.class); suite.addTestSuite(MavenITmng8005IdeWorkspaceReaderUsedTest.class);
suite.addTestSuite(MavenITmng7967ArtifactHandlerLanguageTest.class); suite.addTestSuite(MavenITmng7967ArtifactHandlerLanguageTest.class);

View File

@ -22,6 +22,7 @@ org.apache.groovy:groovy:4.0.15
org.apache.maven:maven-api-spi:4.0.0-alpha-8 org.apache.maven:maven-api-spi:4.0.0-alpha-8
org.apache.maven:maven-api-model:mdo:4.0.0-alpha-8 org.apache.maven:maven-api-model:mdo:4.0.0-alpha-8
org.apache.maven.extensions:maven-extensions:pom:41 org.apache.maven.extensions:maven-extensions:pom:41
org.apache.maven.extensions:maven-build-cache-extension:1.2.0
org.apache.maven.its.plugins.class-loader:dep-c:${project.version} org.apache.maven.its.plugins.class-loader:dep-c:${project.version}
org.apache.maven.its.plugins:maven-it-plugin-active-collection:${project.version} org.apache.maven.its.plugins:maven-it-plugin-active-collection:${project.version}
org.apache.maven.its.plugins:maven-it-plugin-all:${project.version} org.apache.maven.its.plugins:maven-it-plugin-all:${project.version}

View File

@ -0,0 +1,8 @@
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0">
<extension>
<groupId>org.apache.maven.extensions</groupId>
<artifactId>maven-build-cache-extension</artifactId>
<version>1.2.0</version>
</extension>
</extensions>

View File

@ -0,0 +1,52 @@
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>groupId</groupId>
<artifactId>artifactId</artifactId>
<version>1.0-SNAPSHOT</version>
<name>artifactId</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<pluginManagement>
<!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.3.2</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@ -0,0 +1,29 @@
/*
* 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 groupId;
/**
* Hello world!
*
*/
public class App {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}