Skip to content

Commit 7cc86bf

Browse files
authored
Merge pull request #128 from scalacenter/fix-central-publish
bugfix: Use new central plugin for publishing
2 parents d127212 + 2508b1b commit 7cc86bf

2 files changed

Lines changed: 41 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ jobs:
3434
git config --global user.email "123456+github-actions[bot]@users.noreply.github.com"
3535
3636
- name: Publish to Apache Maven Central
37-
run: mvn clean -Darguments=-DskipTests release:prepare release:perform -DreleaseVersion=${{github.event.inputs.version}} -Prelease
37+
run: |
38+
mvn clean install -DskipTests
39+
mvn versions:set -DnewVersion=${{github.event.inputs.version}}
40+
mvn clean deploy -DskipTests -Prelease
3841
env:
3942
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
4043
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}

pom.xml

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,38 @@
129129
<id>release</id>
130130
<build>
131131
<plugins>
132+
<plugin>
133+
<groupId>org.apache.maven.plugins</groupId>
134+
<artifactId>maven-source-plugin</artifactId>
135+
<version>3.3.1</version>
136+
<executions>
137+
<execution>
138+
<id>attach-sources</id>
139+
<goals>
140+
<goal>jar-no-fork</goal>
141+
</goals>
142+
</execution>
143+
</executions>
144+
</plugin>
145+
146+
<plugin>
147+
<groupId>org.apache.maven.plugins</groupId>
148+
<artifactId>maven-javadoc-plugin</artifactId>
149+
<version>3.6.3</version>
150+
<executions>
151+
<execution>
152+
<id>attach-javadocs</id>
153+
<goals>
154+
<goal>jar</goal>
155+
</goals>
156+
<configuration>
157+
<doclint>none</doclint>
158+
<failOnError>false</failOnError>
159+
</configuration>
160+
</execution>
161+
</executions>
162+
</plugin>
163+
132164
<plugin>
133165
<groupId>org.apache.maven.plugins</groupId>
134166
<artifactId>maven-gpg-plugin</artifactId>
@@ -144,14 +176,13 @@
144176
</plugin>
145177

146178
<plugin>
147-
<groupId>org.sonatype.plugins</groupId>
148-
<artifactId>nexus-staging-maven-plugin</artifactId>
149-
<version>1.6.13</version>
179+
<groupId>org.sonatype.central</groupId>
180+
<artifactId>central-publishing-maven-plugin</artifactId>
181+
<version>0.9.0</version>
150182
<extensions>true</extensions>
151183
<configuration>
152-
<nexusUrl>${nexus.url}</nexusUrl>
153-
<serverId>central</serverId>
154-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
184+
<publishingServerId>central</publishingServerId>
185+
<autoPublish>true</autoPublish>
155186
</configuration>
156187
</plugin>
157188
</plugins>

0 commit comments

Comments
 (0)