Skip to content

Commit 3fc5929

Browse files
authored
#36: Fix maven central deployment (#37)
* #36 Fix maven central deployment * Update changelog
1 parent 00e7e6e commit 3fc5929

File tree

8 files changed

+56
-8
lines changed

8 files changed

+56
-8
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
if ! command -v xmlstarlet &> /dev/null
4+
then
5+
echo "xmlstarlet tool is not available, please install it to continue."
6+
exit 1
7+
fi
8+
9+
readonly RELEASE_POM=release-pom.xml
10+
echo "Copying original POM file to $RELEASE_POM"
11+
cp pom.xml "$RELEASE_POM"
12+
13+
CURRENT_VERSION=$(mvn --file "$RELEASE_POM" -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec)
14+
15+
echo "Updating artifactId value for release POM $RELEASE_POM"
16+
xmlstarlet edit -L --ps -N pom="http://maven.apache.org/POM/4.0.0" \
17+
--update "/pom:project/pom:artifactId" \
18+
--value "import-export-udf-common-scala_\${scala.compat.version}" "$RELEASE_POM"
19+

.github/workflows/release_droid_release_on_maven_central.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,19 @@ jobs:
2929
server-password: MAVEN_PASSWORD
3030
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
3131
gpg-passphrase: MAVEN_GPG_PASSPHRASE
32+
- name: Install xmlstarlet
33+
run: sudo apt install -y --no-install-recommends xmlstarlet
34+
- name: Update release pom file
35+
run: ./.github/workflows/createReleasePom.sh
3236
- name: Publish to Central Repository for ${{ matrix.scala-version }}
3337
run: |
34-
mvn clean deploy \
38+
mvn --file release-pom.xml clean deploy \
3539
-P${{ matrix.scala-version }} \
3640
-Dgpg.skip=false \
3741
-Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \
3842
-DskipTests
3943
env:
4044
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
41-
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
45+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
46+
- name: Remove release pom file
47+
run: rm -rf release-pom.xml

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,5 @@ tmp
7171
Desktop.ini
7272
Thumbs.db
7373

74-
*.flattened-pom.xml
74+
*.flattened-pom.xml
75+
release-pom.xml

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Import Export UDF Common Scala
22

33
[![Build Status](https://github.com/exasol/import-export-udf-common-scala/actions/workflows/ci-build.yml/badge.svg)](https://github.com/exasol/import-export-udf-common-scala/actions/workflows/ci-build.yml)
4-
[![Maven Central](https://img.shields.io/maven-central/v/com.exasol/import-export-udf-common-scala)](https://search.maven.org/artifact/com.exasol/import-export-udf-common-scala_2.13)
4+
5+
Scala 2.13: [![Maven Central](https://img.shields.io/maven-central/v/com.exasol/import-export-udf-common-scala_2.13)](https://search.maven.org/artifact/com.exasol/import-export-udf-common-scala_2.13)
6+
Scala 2.12: [![Maven Central](https://img.shields.io/maven-central/v/com.exasol/import-export-udf-common-scala_2.12)](https://search.maven.org/artifact/com.exasol/import-export-udf-common-scala_2.12)
57

68
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aimport-export-udf-common-scala&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.exasol%3Aimport-export-udf-common-scala)
79

doc/changes/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Changes
22

3+
* [0.4.2](changes_0.4.2.md)
34
* [0.4.1](changes_0.4.1.md)
45
* [0.4.0](changes_0.4.0.md)
56
* [0.3.1](changes_0.3.1.md)

doc/changes/changes_0.4.2.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Import Export UDF Common Scala 0.4.2, released 2022-08-03
2+
3+
Code name: Fixed Maven Central deployment
4+
5+
## Summary
6+
7+
The automatic Maven Central deployment tried to upload both variants for Scala 2.12 and 2.13 to the same artifact https://repo1.maven.org/maven2/com/exasol/import-export-udf-common-scala/ which causes the build to fail.
8+
9+
Now they are uploaded with the correct artifact ids:
10+
11+
* https://repo1.maven.org/maven2/com/exasol/import-export-udf-common-scala_2.12/
12+
* https://repo1.maven.org/maven2/com/exasol/import-export-udf-common-scala_2.13/
13+
14+
15+
## Bugfix
16+
17+
* #36: Fixed Maven Central deployment
18+
19+
## Dependency Updates

pk_generated_parent.pom

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.exasol</groupId>
55
<artifactId>import-export-udf-common-scala-generated-parent</artifactId>
6-
<version>0.4.1</version>
6+
<version>0.4.2</version>
77
<packaging>pom</packaging>
88
<properties>
99
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.exasol</groupId>
55
<artifactId>import-export-udf-common-scala</artifactId>
6-
<version>0.4.1</version>
6+
<version>0.4.2</version>
77
<name>Import Export UDF Common Scala</name>
88
<description>Common import export libraries used in Exasol user defined functions</description>
99
<url>https://github.com/exasol/import-export-udf-common-scala/</url>
@@ -398,7 +398,7 @@
398398
<parent>
399399
<artifactId>import-export-udf-common-scala-generated-parent</artifactId>
400400
<groupId>com.exasol</groupId>
401-
<version>0.4.1</version>
401+
<version>0.4.2</version>
402402
<relativePath>pk_generated_parent.pom</relativePath>
403403
</parent>
404-
</project>
404+
</project>

0 commit comments

Comments
 (0)