Skip to content

Commit 0e4dd6c

Browse files
authored
Merge pull request #71 from yunionio/update-mvn-release-config
update pom.xml
2 parents a5ef4a2 + 9acbd00 commit 0e4dd6c

File tree

2 files changed

+113
-69
lines changed

2 files changed

+113
-69
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ all:
44

55
clean:
66
mvn clean
7+
8+
release:
9+
mvn clean deploy -DskipTests -Dgpg.passphrase=${GPG_PASSPHRASE} -Pci-cd

pom.xml

Lines changed: 110 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -75,78 +75,119 @@
7575
</dependency>
7676
</dependencies>
7777

78-
<build>
78+
<distributionManagement>
79+
<snapshotRepository>
80+
<id>ossrh</id>
81+
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
82+
</snapshotRepository>
83+
</distributionManagement>
84+
85+
<build>
86+
<plugins>
87+
<plugin>
88+
<groupId>org.sonatype.plugins</groupId>
89+
<artifactId>nexus-staging-maven-plugin</artifactId>
90+
<version>1.6.7</version>
91+
<extensions>true</extensions>
92+
<configuration>
93+
<serverId>ossrh</serverId>
94+
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
95+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
96+
</configuration>
97+
</plugin>
98+
<plugin>
99+
<groupId>org.apache.maven.plugins</groupId>
100+
<artifactId>maven-source-plugin</artifactId>
101+
<version>3.3.0</version>
102+
<executions>
103+
<execution>
104+
<id>attach-sources</id>
105+
<goals>
106+
<goal>jar-no-fork</goal>
107+
</goals>
108+
</execution>
109+
</executions>
110+
</plugin>
111+
<plugin>
112+
<groupId>org.apache.maven.plugins</groupId>
113+
<artifactId>maven-javadoc-plugin</artifactId>
114+
<version>3.5.0</version>
115+
<executions>
116+
<execution>
117+
<id>attach-javadocs</id>
118+
<goals>
119+
<goal>jar</goal>
120+
</goals>
121+
<configuration>
122+
<show>public</show>
123+
<failOnError>false</failOnError>
124+
<detectOfflineLinks>false</detectOfflineLinks>
125+
<doclint>all,-missing</doclint>
126+
<nohelp>true</nohelp>
127+
<excludePackageNames>*.internal.*,testutil,demo</excludePackageNames>
128+
</configuration>
129+
</execution>
130+
</executions>
131+
<configuration>
132+
<failOnError>false</failOnError>
133+
<tags>
134+
<tag>
135+
<name>date</name>
136+
<placement>a</placement>
137+
<head>Written date:</head>
138+
</tag>
139+
</tags>
140+
</configuration>
141+
</plugin>
142+
<plugin>
143+
<groupId>org.apache.maven.plugins</groupId>
144+
<artifactId>maven-surefire-plugin</artifactId>
145+
<version>3.1.2</version>
146+
<configuration>
147+
<systemPropertyVariables>
148+
<testEnv>/opt/test_conf.properties</testEnv>
149+
</systemPropertyVariables>
150+
</configuration>
151+
</plugin>
152+
<plugin>
153+
<artifactId>maven-release-plugin</artifactId>
154+
<configuration>
155+
<tagNameFormat>v@{project.version}</tagNameFormat>
156+
</configuration>
157+
</plugin>
158+
</plugins>
159+
</build>
160+
161+
<profiles>
162+
<profile>
163+
<id>ci-cd</id>
164+
<build>
79165
<plugins>
80-
<plugin>
81-
<groupId>org.apache.maven.plugins</groupId>
82-
<artifactId>maven-source-plugin</artifactId>
83-
<version>3.3.0</version>
84-
<executions>
85-
<execution>
86-
<id>attach-sources</id>
87-
<goals>
88-
<goal>jar-no-fork</goal>
89-
</goals>
90-
</execution>
91-
</executions>
92-
</plugin>
93-
<plugin>
94-
<groupId>org.apache.maven.plugins</groupId>
95-
<artifactId>maven-javadoc-plugin</artifactId>
96-
<version>3.5.0</version>
97-
<executions>
98-
<execution>
99-
<id>attach-javadocs</id>
100-
<goals>
101-
<goal>jar</goal>
102-
</goals>
103-
</execution>
104-
</executions>
105-
</plugin>
106-
<plugin>
107-
<groupId>org.apache.maven.plugins</groupId>
108-
<artifactId>maven-surefire-plugin</artifactId>
109-
<version>3.1.2</version>
110-
</plugin>
111-
<plugin>
112-
<artifactId>maven-release-plugin</artifactId>
166+
<plugin>
167+
<groupId>org.apache.maven.plugins</groupId>
168+
<artifactId>maven-gpg-plugin</artifactId>
169+
<version>3.1.0</version>
170+
<executions>
171+
<execution>
172+
<id>sign-artifacts</id>
173+
<phase>verify</phase>
174+
<goals>
175+
<goal>sign</goal>
176+
</goals>
113177
<configuration>
114-
<tagNameFormat>v@{project.version}</tagNameFormat>
178+
<!-- Prevent gpg from using pinentry programs. Fixes:
179+
gpg: signing failed: Inappropriate ioctl for device -->
180+
<gpgArguments>
181+
<arg>--pinentry-mode</arg>
182+
<arg>loopback</arg>
183+
</gpgArguments>
115184
</configuration>
116-
</plugin>
185+
</execution>
186+
</executions>
187+
</plugin>
117188
</plugins>
118-
</build>
119-
120-
<profiles>
121-
<profile>
122-
<id>ci-cd</id>
123-
<build>
124-
<plugins>
125-
<plugin>
126-
<groupId>org.apache.maven.plugins</groupId>
127-
<artifactId>maven-gpg-plugin</artifactId>
128-
<version>3.1.0</version>
129-
<executions>
130-
<execution>
131-
<id>sign-artifacts</id>
132-
<phase>verify</phase>
133-
<goals>
134-
<goal>sign</goal>
135-
</goals>
136-
<configuration>
137-
<!-- Prevent gpg from using pinentry programs. Fixes:
138-
gpg: signing failed: Inappropriate ioctl for device -->
139-
<gpgArguments>
140-
<arg>--pinentry-mode</arg>
141-
<arg>loopback</arg>
142-
</gpgArguments>
143-
</configuration>
144-
</execution>
145-
</executions>
146-
</plugin>
147-
</plugins>
148-
</build>
149-
</profile>
150-
</profiles>
189+
</build>
190+
</profile>
191+
</profiles>
151192

152193
</project>

0 commit comments

Comments
 (0)