Skip to content

Commit 655660a

Browse files
committed
Move plugins for release to separate release profile
1 parent b1d4b3a commit 655660a

File tree

3 files changed

+42
-25
lines changed

3 files changed

+42
-25
lines changed

.github/workflows/maven-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
${{ runner.os }}-maven-
3232
3333
- name: Run Tests with Maven
34-
run: mvn -B verify --file pom.xml
34+
run: ./mvnw -B verify

.github/workflows/publish-maven-central.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
- name: Publish to Maven Central
2929
run: |
3030
./mvnw deploy -B \
31+
-Prelease \
3132
-DskipTests
3233
env:
3334
# Maven Central credentials via https://central.sonatype.com/account

pom.xml

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,6 @@
128128

129129
<build>
130130
<plugins>
131-
<plugin>
132-
<groupId>org.sonatype.central</groupId>
133-
<artifactId>central-publishing-maven-plugin</artifactId>
134-
<version>0.7.0</version>
135-
<extensions>true</extensions>
136-
<configuration>
137-
<publishingServerId>central</publishingServerId>
138-
<autoPublish>false</autoPublish>
139-
</configuration>
140-
</plugin>
141131
<plugin>
142132
<groupId>org.apache.maven.plugins</groupId>
143133
<artifactId>maven-source-plugin</artifactId>
@@ -164,20 +154,46 @@
164154
</execution>
165155
</executions>
166156
</plugin>
167-
<plugin>
168-
<groupId>org.apache.maven.plugins</groupId>
169-
<artifactId>maven-gpg-plugin</artifactId>
170-
<version>3.2.7</version>
171-
<executions>
172-
<execution>
173-
<id>sign-artifacts</id>
174-
<phase>verify</phase>
175-
<goals>
176-
<goal>sign</goal>
177-
</goals>
178-
</execution>
179-
</executions>
180-
</plugin>
181157
</plugins>
182158
</build>
159+
160+
<profiles>
161+
<profile>
162+
<id>release</id>
163+
<activation>
164+
<property>
165+
<name>performRelease</name>
166+
<value>true</value>
167+
</property>
168+
</activation>
169+
<build>
170+
<plugins>
171+
<plugin>
172+
<groupId>org.sonatype.central</groupId>
173+
<artifactId>central-publishing-maven-plugin</artifactId>
174+
<version>0.7.0</version>
175+
<extensions>true</extensions>
176+
<configuration>
177+
<publishingServerId>central</publishingServerId>
178+
<autoPublish>false</autoPublish>
179+
</configuration>
180+
</plugin>
181+
<plugin>
182+
<groupId>org.apache.maven.plugins</groupId>
183+
<artifactId>maven-gpg-plugin</artifactId>
184+
<version>3.2.7</version>
185+
<executions>
186+
<execution>
187+
<id>sign-artifacts</id>
188+
<phase>verify</phase>
189+
<goals>
190+
<goal>sign</goal>
191+
</goals>
192+
</execution>
193+
</executions>
194+
</plugin>
195+
</plugins>
196+
</build>
197+
</profile>
198+
</profiles>
183199
</project>

0 commit comments

Comments
 (0)