Skip to content

Commit 0da38da

Browse files
committed
Merge branch 'jann0k/exists-maven-plugin' into 'master'
RM-3338: use exists-maven-plugin See merge request cdoc2/cdoc2-java-ref-impl!35
2 parents 32e843e + c937d81 commit 0da38da

File tree

6 files changed

+51
-19
lines changed

6 files changed

+51
-19
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Example `<profile>` section of `settings.xml` for using cdoc2 dependencies:
187187
</profile>
188188
```
189189

190-
Note: When pulling, the [package index is based on the organization level](https://stackoverflow.com/questions/63041402/github-packages-single-maven-repository-for-github-organization)
190+
Note: When pulling, the [GitHub package index is based on the organization level](https://stackoverflow.com/questions/63041402/github-packages-single-maven-repository-for-github-organization)
191191
, not the repository level.
192192

193193
So defining any Maven package repo from `open-eid` is enough for pulling cdoc2-* dependencies.
@@ -253,3 +253,20 @@ See [cdoc2-cli/README.md](cdoc2-cli/README.md)
253253

254254
See [VERSIONING.md](VERSIONING.md)
255255

256+
## Publishing
257+
258+
### GitHub
259+
260+
Create release on tag done by VERSIONING.md process. It will trigger `maven-release.yml` workflow that
261+
will deploy Maven packages to GitHub Maven package repository.
262+
263+
### Manual
264+
265+
Since build uses `exists-maven-plugin` then `altDeploymentRepository` doesn't work as it only works
266+
for `deploy` plugin. Set `project.distributionManagement` user properties instead:
267+
```
268+
mvn deploy -Dproject.distributionManagement.repository.id=github \
269+
-Dproject.distributionManagement.repository.url=https://maven.pkg.github.com/open-eid/cdoc2-java-ref-impl`
270+
```
271+
272+

cdoc2-cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<artifactId>cdoc2</artifactId>
66
<groupId>ee.cyber.cdoc2</groupId>
7-
<version>1.3.0</version>
7+
<version>1.4.0-SNAPSHOT</version>
88
</parent>
99

1010
<artifactId>cdoc2-cli</artifactId>

cdoc2-client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<artifactId>cdoc2</artifactId>
66
<groupId>ee.cyber.cdoc2</groupId>
7-
<version>1.3.0</version>
7+
<version>1.4.0-SNAPSHOT</version>
88
</parent>
99

1010
<artifactId>cdoc2-client</artifactId>

cdoc2-lib/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<artifactId>cdoc2</artifactId>
55
<groupId>ee.cyber.cdoc2</groupId>
6-
<version>1.3.0</version>
6+
<version>1.4.0-SNAPSHOT</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99

@@ -20,7 +20,7 @@
2020
<dependency>
2121
<groupId>ee.cyber.cdoc2</groupId>
2222
<artifactId>cdoc2-schema</artifactId>
23-
<version>1.2.0</version>
23+
<version>1.3.0-SNAPSHOT</version>
2424
</dependency>
2525

2626
<dependency>

cdoc2-schema/pom.xml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<modelVersion>4.0.0</modelVersion>
44

55
<parent>
6-
<version>1.3.0</version>
6+
<version>1.4.0-SNAPSHOT</version>
77
<groupId>ee.cyber.cdoc2</groupId>
88
<artifactId>cdoc2</artifactId>
99
</parent>
1010

1111
<artifactId>cdoc2-schema</artifactId>
12-
<version>1.2.0</version>
12+
<version>1.3.0-SNAPSHOT</version>
1313

1414
<description>CDOC2 flatbuffer schemas and related functionality </description>
1515

@@ -159,14 +159,6 @@
159159
</execution>
160160
</executions>
161161
</plugin>
162-
<plugin>
163-
<groupId>org.apache.maven.plugins</groupId>
164-
<artifactId>maven-deploy-plugin</artifactId>
165-
<version>3.1.1</version>
166-
<configuration>
167-
<skip>false</skip>
168-
</configuration>
169-
</plugin>
170162
</plugins>
171163
</build>
172164

pom.xml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<modelVersion>4.0.0</modelVersion>
55

6-
<version>1.3.0</version>
6+
<version>1.4.0-SNAPSHOT</version>
77
<groupId>ee.cyber.cdoc2</groupId>
88
<artifactId>cdoc2</artifactId>
99
<description>CDOC2 reference implementation </description>
@@ -291,13 +291,36 @@
291291
</executions>
292292
</plugin>
293293

294+
<!-- if exact RELEASE version of module already exists, -->
295+
<!-- then skip deployment by setting maven.deploy.skip=true property for that module -->
296+
<!-- GitHub doesn't allow overwriting existing RELEASE modules and deploy will fail with HTTP 409 -->
297+
<plugin>
298+
<groupId>org.honton.chas</groupId>
299+
<artifactId>exists-maven-plugin</artifactId>
300+
<version>0.13.0</version>
301+
<executions>
302+
<execution>
303+
<phase>install</phase>
304+
<goals>
305+
<goal>remote</goal>
306+
</goals>
307+
<configuration>
308+
<!-- run only if deploy goal is specified in maven command line -->
309+
<requireGoal>deploy</requireGoal>
310+
</configuration>
311+
</execution>
312+
</executions>
313+
<configuration>
314+
<failIfNotMatch>false</failIfNotMatch>
315+
<userProperty>true</userProperty>
316+
<!--skip>true</skip-->
317+
</configuration>
318+
</plugin>
319+
294320
<plugin>
295321
<groupId>org.apache.maven.plugins</groupId>
296322
<artifactId>maven-deploy-plugin</artifactId>
297323
<version>3.1.1</version>
298-
<configuration>
299-
<skip>false</skip>
300-
</configuration>
301324
</plugin>
302325

303326
</plugins>

0 commit comments

Comments
 (0)