|
15 | 15 | <properties> |
16 | 16 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
17 | 17 | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
18 | | - |
19 | | - <!-- Don't sign artifacts unless the 'stage' or 'release' profile is active --> |
20 | | - <gpg.skip>true</gpg.skip> |
21 | | - |
22 | | - <!-- When deploying, automatically promote artifacts from staging repository --> |
23 | | - <autoReleaseAfterClose>true</autoReleaseAfterClose> |
| 18 | + <maven.compiler.release>8</maven.compiler.release> |
24 | 19 | </properties> |
25 | 20 |
|
26 | 21 | <licenses> |
|
45 | 40 | </developer> |
46 | 41 | </developers> |
47 | 42 |
|
48 | | - <distributionManagement> |
49 | | - <snapshotRepository> |
50 | | - <id>ossrh</id> |
51 | | - <url>https://oss.sonatype.org/content/repositories/snapshots/</url> |
52 | | - </snapshotRepository> |
53 | | - </distributionManagement> |
54 | | - |
55 | | - <repositories> |
56 | | - <repository> |
57 | | - <id>snapshots-repo</id> |
58 | | - <url>https://oss.sonatype.org/content/repositories/snapshots</url> |
59 | | - <releases> |
60 | | - <enabled>false</enabled> |
61 | | - </releases> |
62 | | - <snapshots> |
63 | | - <enabled>true</enabled> |
64 | | - </snapshots> |
65 | | - </repository> |
66 | | - </repositories> |
67 | | - |
68 | 43 | <dependencies> |
69 | 44 | <dependency> |
70 | 45 | <groupId>org.jspecify</groupId> |
|
74 | 49 | <dependency> |
75 | 50 | <groupId>com.fasterxml.jackson.core</groupId> |
76 | 51 | <artifactId>jackson-core</artifactId> |
77 | | - <version>2.18.3</version> |
| 52 | + <version>2.19.0</version> |
78 | 53 | </dependency> |
79 | 54 |
|
80 | 55 | <dependency> |
81 | 56 | <groupId>org.junit.jupiter</groupId> |
82 | 57 | <artifactId>junit-jupiter</artifactId> |
83 | | - <version>5.12.1</version> |
| 58 | + <version>5.13.0</version> |
84 | 59 | <scope>test</scope> |
85 | 60 | </dependency> |
86 | 61 | </dependencies> |
87 | 62 |
|
88 | 63 | <build> |
| 64 | + <pluginManagement> |
| 65 | + <plugins> |
| 66 | + <plugin> |
| 67 | + <groupId>org.apache.maven.plugins</groupId> |
| 68 | + <artifactId>maven-enforcer-plugin</artifactId> |
| 69 | + <version>3.5.0</version> |
| 70 | + </plugin> |
| 71 | + </plugins> |
| 72 | + </pluginManagement> |
| 73 | + |
89 | 74 | <plugins> |
90 | 75 | <plugin> |
91 | 76 | <groupId>org.apache.maven.plugins</groupId> |
92 | 77 | <artifactId>maven-compiler-plugin</artifactId> |
93 | 78 | <version>3.14.0</version> |
94 | | - <configuration> |
95 | | - <release>8</release> |
96 | | - </configuration> |
97 | 79 | </plugin> |
98 | 80 | <plugin> |
99 | 81 | <groupId>org.apache.maven.plugins</groupId> |
|
152 | 134 | <executions> |
153 | 135 | <execution> |
154 | 136 | <id>sign-artifacts</id> |
155 | | - <phase>verify</phase> |
| 137 | + <phase>deploy</phase> |
156 | 138 | <goals> |
157 | 139 | <goal>sign</goal> |
158 | 140 | </goals> |
159 | | - <configuration> |
160 | | - <gpgArguments> |
161 | | - <!-- Bypass gpg agent --> |
162 | | - <arg>--pinentry-mode</arg> |
163 | | - <arg>loopback</arg> |
164 | | - </gpgArguments> |
165 | | - </configuration> |
166 | 141 | </execution> |
167 | 142 | </executions> |
168 | 143 | </plugin> |
169 | 144 | <plugin> |
170 | | - <groupId>org.sonatype.plugins</groupId> |
171 | | - <artifactId>nexus-staging-maven-plugin</artifactId> |
172 | | - <version>1.7.0</version> |
| 145 | + <groupId>org.sonatype.central</groupId> |
| 146 | + <artifactId>central-publishing-maven-plugin</artifactId> |
| 147 | + <version>0.7.0</version> |
173 | 148 | <extensions>true</extensions> |
174 | 149 | <configuration> |
175 | | - <serverId>ossrh</serverId> |
176 | | - <nexusUrl>https://oss.sonatype.org/</nexusUrl> |
177 | | - <autoReleaseAfterClose>${autoReleaseAfterClose}</autoReleaseAfterClose> |
| 150 | + <autoPublish>true</autoPublish> |
| 151 | + <waitUntil>published</waitUntil> |
178 | 152 | </configuration> |
179 | 153 | </plugin> |
180 | 154 | <plugin> |
|
204 | 178 | </execution> |
205 | 179 | </executions> |
206 | 180 | </plugin> |
| 181 | + <!-- Require profile `snapshot` or `release` when deploying. |
| 182 | + Having explicit profiles (instead of relying on deploy plugin's |
| 183 | + automatic snapshot/release routing) prevents the "on push" |
| 184 | + snapshot publish action from accidentally publishing a release version. --> |
| 185 | + <plugin> |
| 186 | + <groupId>org.apache.maven.plugins</groupId> |
| 187 | + <artifactId>maven-enforcer-plugin</artifactId> |
| 188 | + <executions> |
| 189 | + <execution> |
| 190 | + <id>enforce-deploy-has-active-profile</id> |
| 191 | + <phase>deploy</phase> |
| 192 | + <goals> |
| 193 | + <goal>enforce</goal> |
| 194 | + </goals> |
| 195 | + <configuration> |
| 196 | + <rules> |
| 197 | + <requireProfileIdsExist/> |
| 198 | + <requireActiveProfile> |
| 199 | + <profiles>snapshot,release</profiles> |
| 200 | + <all>false</all> |
| 201 | + </requireActiveProfile> |
| 202 | + </rules> |
| 203 | + <fail>true</fail> |
| 204 | + </configuration> |
| 205 | + </execution> |
| 206 | + </executions> |
| 207 | + </plugin> |
207 | 208 | </plugins> |
208 | 209 | </build> |
209 | 210 |
|
210 | 211 | <profiles> |
211 | 212 | <profile> |
212 | | - <id>release</id> |
213 | | - <activation> |
214 | | - <property> |
215 | | - <name>release</name> |
216 | | - </property> |
217 | | - </activation> |
218 | | - <properties> |
219 | | - <gpg.skip>false</gpg.skip> |
220 | | - </properties> |
| 213 | + <id>snapshot</id> |
221 | 214 | <build> |
222 | 215 | <plugins> |
223 | 216 | <plugin> |
224 | 217 | <groupId>org.apache.maven.plugins</groupId> |
225 | 218 | <artifactId>maven-enforcer-plugin</artifactId> |
226 | | - <version>3.5.0</version> |
227 | 219 | <executions> |
228 | 220 | <execution> |
229 | | - <id>enforce-release</id> |
| 221 | + <id>enforce-snapshot</id> |
230 | 222 | <goals> |
231 | 223 | <goal>enforce</goal> |
232 | 224 | </goals> |
233 | 225 | <configuration> |
234 | 226 | <rules> |
235 | | - <requireReleaseVersion> |
236 | | - <message>Not a release version (remove -SNAPSHOT suffix!)</message> |
237 | | - </requireReleaseVersion> |
238 | | - <requireReleaseDeps> |
239 | | - <message>Can't release with snapshot dependencies!</message> |
240 | | - </requireReleaseDeps> |
| 227 | + <requireSnapshotVersion> |
| 228 | + <message>Not a SNAPSHOT version!</message> |
| 229 | + </requireSnapshotVersion> |
241 | 230 | </rules> |
242 | 231 | <fail>true</fail> |
243 | 232 | </configuration> |
|
248 | 237 | </build> |
249 | 238 | </profile> |
250 | 239 | <profile> |
251 | | - <id>snapshot</id> |
252 | | - <properties> |
253 | | - <gpg.skip>false</gpg.skip> |
254 | | - </properties> |
| 240 | + <id>release</id> |
255 | 241 | <build> |
256 | 242 | <plugins> |
257 | 243 | <plugin> |
258 | 244 | <groupId>org.apache.maven.plugins</groupId> |
259 | 245 | <artifactId>maven-enforcer-plugin</artifactId> |
260 | | - <version>3.5.0</version> |
261 | 246 | <executions> |
262 | 247 | <execution> |
263 | | - <id>enforce-no-releases</id> |
| 248 | + <id>enforce-release</id> |
264 | 249 | <goals> |
265 | 250 | <goal>enforce</goal> |
266 | 251 | </goals> |
267 | 252 | <configuration> |
268 | 253 | <rules> |
269 | | - <requireSnapshotVersion> |
270 | | - <message>Not a snapshot version</message> |
271 | | - </requireSnapshotVersion> |
| 254 | + <requireReleaseVersion> |
| 255 | + <message>Not a release version (remove -SNAPSHOT suffix!)</message> |
| 256 | + </requireReleaseVersion> |
| 257 | + <requireReleaseDeps> |
| 258 | + <message>Can't release with snapshot dependencies!</message> |
| 259 | + </requireReleaseDeps> |
272 | 260 | </rules> |
273 | 261 | <fail>true</fail> |
274 | 262 | </configuration> |
|
0 commit comments