Skip to content

Commit 942c34c

Browse files
authored
Merge pull request #185 from oracle/enforce-and-dependencies
Add Maven enforcer plugin and update dependency versions
2 parents 0a7e8f2 + 5fe2e28 commit 942c34c

File tree

8 files changed

+283
-17
lines changed

8 files changed

+283
-17
lines changed

.github/workflows/build.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ jobs:
1313
- uses: actions/checkout@v2
1414
with:
1515
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
16-
- name: Set up JDK 11
17-
uses: actions/setup-java@v1
16+
- name: Set up JDK
17+
uses: actions/setup-java@v3
1818
with:
19-
java-version: 11
19+
distribution: 'temurin'
20+
java-version: 17
2021
- name: Cache SonarCloud packages
2122
uses: actions/cache@v1
2223
with:

Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
# First layer: dependencies for the project, cached in the /root/.m2 directory
5-
FROM maven:3.6-jdk-11 as m2repo
5+
FROM maven:3.8.6-eclipse-temurin-17 as m2repo
66
ARG MAVEN_OPTS
77

88
WORKDIR /project/
@@ -13,7 +13,7 @@ COPY wls-exporter-sidecar/pom.xml wls-exporter-sidecar/
1313
RUN mvn -B -e -C org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline -Ddocker-build
1414

1515
# Now build the project on top of that first layer
16-
FROM maven:3.6-jdk-11 as build
16+
FROM maven:3.8.6-eclipse-temurin-17 as build
1717
ARG MAVEN_OPTS
1818

1919
WORKDIR /project/
@@ -26,7 +26,7 @@ RUN mvn -B -e -C install -Ddocker-build -DskipTests=true
2626

2727
FROM ghcr.io/oracle/oraclelinux:8-slim AS jre-build
2828

29-
ENV JAVA_URL="https://download.java.net/java/GA/jdk18.0.1.1/65ae32619e2f40f3a9af3af1851d6e19/2/GPL/openjdk-18.0.1.1_linux-x64_bin.tar.gz"
29+
ENV JAVA_URL="https://download.java.net/java/GA/jdk18.0.2/f6ad4b4450fd4d298113270ec84f30ee/9/GPL/openjdk-18.0.2_linux-x64_bin.tar.gz"
3030

3131
RUN set -eux; \
3232
microdnf -y install gzip tar; \

build-helper-mojo/pom.xml

+46
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,50 @@
5050
<scope>test</scope>
5151
</dependency>
5252
</dependencies>
53+
54+
<build>
55+
<plugins>
56+
<plugin>
57+
<groupId>org.apache.maven.plugins</groupId>
58+
<artifactId>maven-clean-plugin</artifactId>
59+
<version>${maven-clean-plugin-version}</version>
60+
</plugin>
61+
62+
<plugin>
63+
<groupId>org.apache.maven.plugins</groupId>
64+
<artifactId>maven-plugin-plugin</artifactId>
65+
<version>${maven-plugin-plugin-version}</version>
66+
</plugin>
67+
68+
<plugin>
69+
<groupId>org.apache.maven.plugins</groupId>
70+
<artifactId>maven-install-plugin</artifactId>
71+
<version>${maven-install-plugin-version}</version>
72+
</plugin>
73+
74+
<plugin>
75+
<groupId>org.apache.maven.plugins</groupId>
76+
<artifactId>maven-site-plugin</artifactId>
77+
<version>${maven-site-plugin-version}</version>
78+
</plugin>
79+
80+
<plugin>
81+
<groupId>org.apache.maven.plugins</groupId>
82+
<artifactId>maven-deploy-plugin</artifactId>
83+
<version>${maven-deploy-plugin-version}</version>
84+
</plugin>
85+
86+
<plugin>
87+
<groupId>org.apache.maven.plugins</groupId>
88+
<artifactId>maven-resources-plugin</artifactId>
89+
<version>${maven-resources-plugin-version}</version>
90+
</plugin>
91+
92+
<plugin>
93+
<groupId>org.apache.maven.plugins</groupId>
94+
<artifactId>maven-jar-plugin</artifactId>
95+
<version>${maven-jar-plugin-version}</version>
96+
</plugin>
97+
</plugins>
98+
</build>
5399
</project>

pom.xml

+113-6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<developerConnection>scm:git:https://github.com/oracle/weblogic-monitoring-exporter.git</developerConnection>
3131
<connection>scm:git:https://github.com/oracle/weblogic-monitoring-exporter.git</connection>
3232
<tag>HEAD</tag>
33-
</scm>
33+
</scm>
3434

3535
<developers>
3636
<developer>
@@ -49,14 +49,67 @@
4949
<version.plugin.surefire>3.0.0-M7</version.plugin.surefire>
5050
<maven.compiler.source>8</maven.compiler.source>
5151
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
52+
<maven-enforcer-plugin-version>3.1.0</maven-enforcer-plugin-version>
53+
<maven-clean-plugin-version>3.2.0</maven-clean-plugin-version>
54+
<maven-compiler-plugin-version>3.10.1</maven-compiler-plugin-version>
55+
<maven-install-plugin-version>3.0.1</maven-install-plugin-version>
56+
<maven-deploy-plugin-version>3.0.0</maven-deploy-plugin-version>
57+
<maven-deploy-plugin-version>3.0.0</maven-deploy-plugin-version>
58+
<maven-plugin-plugin-version>3.6.4</maven-plugin-plugin-version>
59+
<maven-site-plugin-version>3.12.1</maven-site-plugin-version>
60+
<maven-jar-plugin-version>3.2.2</maven-jar-plugin-version>
61+
<maven-war-plugin-version>3.3.2</maven-war-plugin-version>
62+
<maven-resources-plugin-version>3.3.0</maven-resources-plugin-version>
63+
<maven-dependency-plugin-version>3.3.0</maven-dependency-plugin-version>
64+
65+
<java.version.range>17</java.version.range>
66+
<maven.version.range>[3.6.1,)</maven.version.range>
5267
</properties>
5368

5469
<build>
5570
<pluginManagement>
5671
<plugins>
72+
<plugin>
73+
<groupId>org.apache.maven.plugins</groupId>
74+
<artifactId>maven-enforcer-plugin</artifactId>
75+
<version>${maven-enforcer-plugin-version}</version>
76+
<executions>
77+
<execution>
78+
<id>enforce-maven</id>
79+
<goals>
80+
<goal>enforce</goal>
81+
</goals>
82+
<configuration>
83+
<rules>
84+
<requireMavenVersion>
85+
<version>${maven.version.range}</version>
86+
</requireMavenVersion>
87+
<requireJavaVersion>
88+
<version>${java.version.range}</version>
89+
</requireJavaVersion>
90+
<requirePluginVersions></requirePluginVersions>
91+
</rules>
92+
</configuration>
93+
</execution>
94+
</executions>
95+
</plugin>
96+
97+
<plugin>
98+
<groupId>org.apache.maven.plugins</groupId>
99+
<artifactId>maven-compiler-plugin</artifactId>
100+
<version>${maven-compiler-plugin-version}</version>
101+
<configuration>
102+
<release>11</release>
103+
<compilerArgs>
104+
<arg>-Xpkginfo:always</arg>
105+
<arg>-Xlint:all</arg>
106+
</compilerArgs>
107+
</configuration>
108+
</plugin>
109+
57110
<plugin>
58111
<artifactId>maven-war-plugin</artifactId>
59-
<version>2.6</version>
112+
<version>${maven-war-plugin-version}</version>
60113
<configuration>
61114
<failOnMissingWebXml>false</failOnMissingWebXml>
62115
<warSourceDirectory>${configuration.directory}</warSourceDirectory>
@@ -97,6 +150,61 @@
97150
</plugin>
98151
</plugins>
99152
</pluginManagement>
153+
154+
<plugins>
155+
<plugin>
156+
<groupId>org.apache.maven.plugins</groupId>
157+
<artifactId>maven-enforcer-plugin</artifactId>
158+
</plugin>
159+
160+
<plugin>
161+
<groupId>org.apache.maven.plugins</groupId>
162+
<artifactId>maven-clean-plugin</artifactId>
163+
<version>${maven-clean-plugin-version}</version>
164+
</plugin>
165+
166+
<plugin>
167+
<groupId>org.apache.maven.plugins</groupId>
168+
<artifactId>maven-resources-plugin</artifactId>
169+
<version>${maven-resources-plugin-version}</version>
170+
</plugin>
171+
172+
<plugin>
173+
<groupId>org.apache.maven.plugins</groupId>
174+
<artifactId>maven-jar-plugin</artifactId>
175+
<version>${maven-jar-plugin-version}</version>
176+
</plugin>
177+
178+
<plugin>
179+
<groupId>org.apache.maven.plugins</groupId>
180+
<artifactId>maven-plugin-plugin</artifactId>
181+
<version>${maven-plugin-plugin-version}</version>
182+
</plugin>
183+
184+
<plugin>
185+
<groupId>org.apache.maven.plugins</groupId>
186+
<artifactId>maven-dependency-plugin</artifactId>
187+
<version>${maven-dependency-plugin-version}</version>
188+
</plugin>
189+
190+
<plugin>
191+
<groupId>org.apache.maven.plugins</groupId>
192+
<artifactId>maven-install-plugin</artifactId>
193+
<version>${maven-install-plugin-version}</version>
194+
</plugin>
195+
196+
<plugin>
197+
<groupId>org.apache.maven.plugins</groupId>
198+
<artifactId>maven-site-plugin</artifactId>
199+
<version>${maven-site-plugin-version}</version>
200+
</plugin>
201+
202+
<plugin>
203+
<groupId>org.apache.maven.plugins</groupId>
204+
<artifactId>maven-deploy-plugin</artifactId>
205+
<version>${maven-deploy-plugin-version}</version>
206+
</plugin>
207+
</plugins>
100208
</build>
101209

102210
<dependencyManagement>
@@ -130,7 +238,7 @@
130238
<dependency>
131239
<groupId>com.google.code.gson</groupId>
132240
<artifactId>gson</artifactId>
133-
<version>2.9.0</version>
241+
<version>2.9.1</version>
134242
</dependency>
135243
<dependency>
136244
<groupId>commons-io</groupId>
@@ -166,13 +274,13 @@
166274
<dependency>
167275
<groupId>org.junit.jupiter</groupId>
168276
<artifactId>junit-jupiter</artifactId>
169-
<version>5.8.2</version>
277+
<version>5.9.0</version>
170278
<scope>test</scope>
171279
</dependency>
172280
<dependency>
173281
<groupId>com.meterware.simplestub</groupId>
174282
<artifactId>simplestub</artifactId>
175-
<version>1.3.0</version>
283+
<version>1.3.2</version>
176284
<scope>test</scope>
177285
</dependency>
178286
<dependency>
@@ -219,5 +327,4 @@
219327
</modules>
220328
</profile>
221329
</profiles>
222-
223330
</project>

samples/kubernetes/end2end/demo-domains/domainBuilder/test-webapp/pom.xml

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
<plugin>
3636
<groupId>org.apache.maven.plugins</groupId>
3737
<artifactId>maven-war-plugin</artifactId>
38-
<version>2.3</version>
3938
<configuration>
4039
<failOnMissingWebXml>false</failOnMissingWebXml>
4140
</configuration>

wls-exporter-core/pom.xml

+37-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,42 @@
8888
<groupId>org.jacoco</groupId>
8989
<artifactId>jacoco-maven-plugin</artifactId>
9090
</plugin>
91+
92+
<plugin>
93+
<groupId>org.apache.maven.plugins</groupId>
94+
<artifactId>maven-clean-plugin</artifactId>
95+
<version>${maven-clean-plugin-version}</version>
96+
</plugin>
97+
98+
<plugin>
99+
<groupId>org.apache.maven.plugins</groupId>
100+
<artifactId>maven-install-plugin</artifactId>
101+
<version>${maven-install-plugin-version}</version>
102+
</plugin>
103+
104+
<plugin>
105+
<groupId>org.apache.maven.plugins</groupId>
106+
<artifactId>maven-site-plugin</artifactId>
107+
<version>${maven-site-plugin-version}</version>
108+
</plugin>
109+
110+
<plugin>
111+
<groupId>org.apache.maven.plugins</groupId>
112+
<artifactId>maven-deploy-plugin</artifactId>
113+
<version>${maven-deploy-plugin-version}</version>
114+
</plugin>
115+
116+
<plugin>
117+
<groupId>org.apache.maven.plugins</groupId>
118+
<artifactId>maven-resources-plugin</artifactId>
119+
<version>${maven-resources-plugin-version}</version>
120+
</plugin>
121+
122+
<plugin>
123+
<groupId>org.apache.maven.plugins</groupId>
124+
<artifactId>maven-jar-plugin</artifactId>
125+
<version>${maven-jar-plugin-version}</version>
126+
</plugin>
91127
</plugins>
92128
</build>
93129

@@ -99,7 +135,7 @@
99135
<plugin>
100136
<groupId>org.codehaus.mojo</groupId>
101137
<artifactId>build-helper-maven-plugin</artifactId>
102-
<version>3.2.0</version>
138+
<version>3.3.0</version>
103139
<executions>
104140
<execution>
105141
<id>add-source</id>

0 commit comments

Comments
 (0)