Skip to content

Commit ae39337

Browse files
Merge pull request cdapio#285 from cdapio/ossrh-migration
Use central-publishing-maven-plugin for deploy.
2 parents 16c3de7 + 1f4b727 commit ae39337

2 files changed

Lines changed: 6 additions & 58 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,7 @@ jobs:
6161
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
6262
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
6363
64-
- name: Check if version already exists in Maven Central
65-
id: check_maven
66-
working-directory: e2e
67-
run: |
68-
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
69-
70-
URL="https://repo1.maven.org/maven2/io/cdap/tests/e2e/cdap-e2e-framework/${VERSION}/"
71-
echo "Checking if artifact exists: $URL"
72-
73-
if curl --silent --fail --head "$URL"; then
74-
echo "artifact exists"
75-
echo "exists=true" >> $GITHUB_OUTPUT
76-
else
77-
echo "artifact does not exists"
78-
echo "exists=false" >> $GITHUB_OUTPUT
79-
fi
80-
8164
- name: Build and Deploy
82-
if: steps.check_maven.outputs.exists == 'false'
8365
working-directory: e2e
8466
run: mvn -B -V -DskipTests clean deploy -P release -Dgpg.passphrase=$CDAP_GPG_PASSPHRASE -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=30
8567
env:

pom.xml

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -47,28 +47,7 @@ the License.-->
4747
<tag>HEAD</tag>
4848
</scm>
4949

50-
<distributionManagement>
51-
<repository>
52-
<id>sonatype.release</id>
53-
<url>https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2</url>
54-
</repository>
55-
<snapshotRepository>
56-
<id>sonatype.snapshots</id>
57-
<url>https://central.sonatype.com/repository/maven-snapshots</url>
58-
</snapshotRepository>
59-
</distributionManagement>
60-
6150
<repositories>
62-
<repository>
63-
<id>sonatype</id>
64-
<url>https://ossrh-staging-api.central.sonatype.com/content/groups/public</url>
65-
<releases>
66-
<enabled>true</enabled>
67-
</releases>
68-
<snapshots>
69-
<enabled>false</enabled>
70-
</snapshots>
71-
</repository>
7251
<repository>
7352
<id>sonatype-snapshots</id>
7453
<url>https://central.sonatype.com/repository/maven-snapshots</url>
@@ -256,27 +235,14 @@ the License.-->
256235
</plugin>
257236

258237
<plugin>
259-
<groupId>org.apache.maven.plugins</groupId>
260-
<artifactId>maven-release-plugin</artifactId>
261-
<version>2.5.3</version>
262-
<configuration>
263-
<tag>v${releaseVersion}</tag>
264-
<tagNameFormat>v@{project.version}</tagNameFormat>
265-
<autoVersionSubmodules>true</autoVersionSubmodules>
266-
<!-- releaseProfiles configuration will actually force a Maven profile
267-
– the `releases` profile – to become active during the Release process. -->
268-
<releaseProfiles>releases</releaseProfiles>
269-
</configuration>
270-
</plugin>
271-
272-
<plugin>
273-
<groupId>org.sonatype.plugins</groupId>
274-
<artifactId>nexus-staging-maven-plugin</artifactId>
275-
<version>1.6.14</version>
238+
<groupId>org.sonatype.central</groupId>
239+
<artifactId>central-publishing-maven-plugin</artifactId>
240+
<version>0.8.0</version>
276241
<extensions>true</extensions>
277242
<configuration>
278-
<nexusUrl>https://ossrh-staging-api.central.sonatype.com</nexusUrl>
279-
<serverId>sonatype.release</serverId>
243+
<publishingServerId>sonatype.release</publishingServerId>
244+
<autoPublish>false</autoPublish>
245+
<ignorePublishedComponents>true</ignorePublishedComponents>
280246
</configuration>
281247
</plugin>
282248
</plugins>

0 commit comments

Comments
 (0)