-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MBUILDCACHE-81] - Add an option to include project version as part o…
…f the cache hash key (#129) * Fix MBUILDCACHE-76 regression with process version checksum calculation * Update Issue76Test project name to mbuildcache-76
- Loading branch information
Showing
11 changed files
with
230 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
src/test/java/org/apache/maven/buildcache/its/Issue76Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* 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.buildcache.its; | ||
|
||
import org.apache.maven.buildcache.its.junit.IntegrationTest; | ||
import org.apache.maven.it.VerificationException; | ||
import org.apache.maven.it.Verifier; | ||
import org.junit.jupiter.api.Test; | ||
|
||
@IntegrationTest("src/test/projects/mbuildcache-76") | ||
public class Issue76Test { | ||
|
||
private static final String PROJECT_NAME = "org.apache.maven.caching.test:mbuildcache-76"; | ||
|
||
@Test | ||
void simple_build_change_version_build_install_again(Verifier verifier) throws VerificationException { | ||
verifier.setAutoclean(false); | ||
|
||
verifier.setLogFileName("../log-1.txt"); | ||
verifier.executeGoal("install"); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.verifyTextInLog("Saved Build to local file"); | ||
verifier.verifyArtifactPresent("org.apache.maven.caching.test", "mbuildcache-76", "0.0.1-SNAPSHOT", "jar"); | ||
|
||
verifier.setLogFileName("../log-2.txt"); | ||
verifier.executeGoal("install"); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.verifyTextInLog("Found cached build, restoring " + PROJECT_NAME + " from cache"); | ||
|
||
verifier.setLogFileName("../log-3.txt"); | ||
verifier.getCliOptions().clear(); | ||
verifier.addCliOption("-DoldVersion=0.0.1-SNAPSHOT"); | ||
verifier.addCliOption("-DnewVersion=0.0.2-SNAPSHOT"); | ||
verifier.executeGoal("versions:set"); | ||
verifier.verifyErrorFreeLog(); | ||
|
||
verifier.getCliOptions().clear(); | ||
verifier.setLogFileName("../log-4.txt"); | ||
verifier.executeGoal("install"); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.verifyTextInLog("Saved Build to local file"); | ||
verifier.verifyArtifactPresent("org.apache.maven.caching.test", "mbuildcache-76", "0.0.2-SNAPSHOT", "jar"); | ||
|
||
verifier.setLogFileName("../log-5.txt"); | ||
verifier.executeGoal("install"); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.verifyTextInLog("Found cached build, restoring " + PROJECT_NAME + " from cache"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright 2021 the original author or authors. | ||
Licensed 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. | ||
--> | ||
<extensions> | ||
<extension> | ||
<groupId>org.apache.maven.extensions</groupId> | ||
<artifactId>maven-build-cache-extension</artifactId> | ||
<version>${projectVersion}</version> | ||
</extension> | ||
</extensions> |
26 changes: 26 additions & 0 deletions
26
src/test/projects/mbuildcache-76/.mvn/maven-build-cache-config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<!-- | ||
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. | ||
--> | ||
|
||
<cache xmlns="http://maven.apache.org/CACHE-CONFIG/1.0.0"> | ||
<configuration> | ||
<projectVersioning calculateProjectVersionChecksum="true"/> | ||
</configuration> | ||
</cache> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!-- | ||
Copyright 2021 the original author or authors. | ||
Licensed 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. | ||
--> | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.apache.maven.caching.test</groupId> | ||
<artifactId>mbuildcache-76</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<properties> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
</properties> | ||
|
||
|
||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>versions-maven-plugin</artifactId> | ||
<version>2.16.0</version> | ||
<configuration> | ||
<generateBackupPoms>false</generateBackupPoms> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
|
||
</project> |
24 changes: 24 additions & 0 deletions
24
src/test/projects/mbuildcache-76/src/main/java/org/apache/maven/buildcache/Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* 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.buildcache; | ||
|
||
class Test | ||
{ | ||
|
||
} |