Skip to content

Commit 36d9d7f

Browse files
ericbottardilayaperumalg
authored andcommitted
Add Maven Build Cache plugin
The build cache extension caches the results of maven goal executions and skips re-running them if the same inputs are detected again. This helps both local development (re run tests of affected modules only) and CI builds eventually (a subsequent commit will introduce sharing of the cache between CI runs) Signed-off-by: Eric Bottard <eric.bottard@broadcom.com>
1 parent b75af37 commit 36d9d7f

File tree

3 files changed

+41
-2
lines changed

3 files changed

+41
-2
lines changed

.mvn/extensions.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@
2121
<artifactId>maven-profiler</artifactId>
2222
<version>3.2</version>
2323
</extension>
24+
<extension>
25+
<groupId>org.apache.maven.extensions</groupId>
26+
<artifactId>maven-build-cache-extension</artifactId>
27+
<version>1.2.1</version>
28+
</extension>
2429
</extensions>

.mvn/maven-build-cache-config.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<cache xmlns="http://maven.apache.org/BUILD-CACHE-CONFIG/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE-CONFIG/1.2.0 https://maven.apache.org/xsd/build-cache-config-1.2.0.xsd">
2+
<input>
3+
<global>
4+
<includes>
5+
<!-- By default, project sources and resources directories are included (src/main/java and src/main/resources) -->
6+
<!-- Here, the goal is to include a wider range of src directories (like src/main/assembly or src/main/antora) -->
7+
<include>src/</include>
8+
</includes>
9+
</global>
10+
</input>
11+
<executionControl>
12+
<reconcile>
13+
<plugins>
14+
<plugin artifactId="maven-surefire-plugin" goal="test">
15+
<reconciles>
16+
<reconcile propertyName="skip" skipValue="true"/>
17+
<reconcile propertyName="skipExec" skipValue="true"/>
18+
<reconcile propertyName="skipTests" skipValue="true"/>
19+
</reconciles>
20+
</plugin>
21+
<plugin artifactId="maven-failsafe-plugin" goal="integration-test">
22+
<reconciles>
23+
<reconcile propertyName="skip" skipValue="true"/>
24+
<reconcile propertyName="skipExec" skipValue="true"/>
25+
<reconcile propertyName="skipITs" skipValue="true"/>
26+
<reconcile propertyName="skipTests" skipValue="true"/>
27+
</reconciles>
28+
</plugin>
29+
30+
</plugins>
31+
</reconcile>
32+
</executionControl>
33+
</cache>

.mvn/wrapper/maven-wrapper.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
17-
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
16+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
17+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar
18+

0 commit comments

Comments
 (0)