Skip to content

Commit 6f9d037

Browse files
authored
Merge pull request #15 from tangyang9464/fix2
fix: add pom.xml content and add maven release
2 parents b8d7525 + 71643c0 commit 6f9d037

File tree

4 files changed

+165
-26
lines changed

4 files changed

+165
-26
lines changed

.github/workflows/maven-ci.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,13 @@ jobs:
2222
- name: Build with Maven
2323
run: mvn clean test
2424

25-
semantic-release:
26-
needs: [build]
27-
runs-on: ubuntu-latest
28-
steps:
29-
30-
- uses: actions/checkout@v2
31-
32-
- name: Run semantic-release
33-
if: github.event_name == 'push'
25+
- name: Sematic Release
3426
run: |
35-
npm install --save-dev semantic-release@17.2.4
36-
npx semantic-release
27+
npm install -g @conveyal/maven-semantic-release semantic-release
28+
semantic-release --prepare @conveyal/maven-semantic-release --publish @semantic-release/github,@conveyal/maven-semantic-release --verify-conditions @semantic-release/github,@conveyal/maven-semantic-release --verify-release @conveyal/maven-semantic-release
3729
env:
3830
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
32+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
33+
OSSRH_JIRA_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }}
34+
OSSRH_JIRA_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }}

.releaserc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"debug": true,
3+
"dryRun": false,
34
"branches": [
45
"+([0-9])?(.{+([0-9]),x}).x",
56
"master",

maven-settings.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<settings>
2+
<servers>
3+
<server>
4+
<id>ossrh</id>
5+
<username>${OSSRH_JIRA_USERNAME}</username>
6+
<password>${OSSRH_JIRA_PASSWORD}</password>
7+
</server>
8+
</servers>
9+
<profiles>
10+
<profile>
11+
<id>ossrh</id>
12+
<activation>
13+
<activeByDefault>true</activeByDefault>
14+
</activation>
15+
<properties>
16+
<gpg.executable>gpg</gpg.executable>
17+
<gpg.keyname>${GPG_KEY_NAME}</gpg.keyname>
18+
<gpg.passphrase>${GPG_PASSPHRASE}</gpg.passphrase>
19+
</properties>
20+
</profile>
21+
</profiles>
22+
</settings>

pom.xml

Lines changed: 135 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,52 @@
88
<artifactId>jcasbin-redis-watcher</artifactId>
99
<version>0.0.1</version>
1010

11+
<issueManagement>
12+
<system>Github</system>
13+
<url>https://github.com/jcasbin/redis-watcher/issues</url>
14+
</issueManagement>
15+
16+
<parent>
17+
<groupId>org.sonatype.oss</groupId>
18+
<artifactId>oss-parent</artifactId>
19+
<version>7</version>
20+
</parent>
21+
<licenses>
22+
<license>
23+
<name>The Apache Software License, Version 2.0</name>
24+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
25+
<distribution>repo</distribution>
26+
</license>
27+
</licenses>
28+
<scm>
29+
<url>https://github.com/jcasbin/redis-watcher</url>
30+
<connection>scm:[email protected]:jcasbin/redis-watcher.git</connection>
31+
<developerConnection>scm:git:https://github.com/jcasbin/redis-watcher.git</developerConnection>
32+
</scm>
33+
<developers>
34+
<developer>
35+
<name>Yang Luo</name>
36+
<email>[email protected]</email>
37+
<url>https://github.com/hsluoyz</url>
38+
</developer>
39+
</developers>
40+
1141
<properties>
12-
<maven.compiler.source>1.8</maven.compiler.source>
13-
<maven.compiler.target>1.8</maven.compiler.target>
1442
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1543
<slf4j.version>1.7.25</slf4j.version>
1644
</properties>
1745

46+
<distributionManagement>
47+
<snapshotRepository>
48+
<id>ossrh</id>
49+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
50+
</snapshotRepository>
51+
<repository>
52+
<id>ossrh</id>
53+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
54+
</repository>
55+
</distributionManagement>
56+
1857
<dependencies>
1958
<dependency>
2059
<groupId>org.slf4j</groupId>
@@ -46,19 +85,100 @@
4685
</dependencies>
4786

4887
<build>
49-
<resources>
50-
<resource>
51-
<directory>src/main/java</directory>
52-
<includes>
53-
<include>**/*.*</include>
54-
</includes>
55-
<excludes>
56-
<exclude>**/*.java</exclude>
57-
</excludes>
58-
<filtering>false</filtering>
59-
</resource>
60-
</resources>
6188
<plugins>
89+
<plugin>
90+
<groupId>org.apache.maven.plugins</groupId>
91+
<artifactId>maven-gpg-plugin</artifactId>
92+
<version>1.5</version>
93+
<executions>
94+
<execution>
95+
<id>sign-artifacts</id>
96+
<phase>verify</phase>
97+
<goals>
98+
<goal>sign</goal>
99+
</goals>
100+
</execution>
101+
</executions>
102+
<configuration>
103+
<!-- Prevent gpg from using pinentry programs -->
104+
<gpgArguments>
105+
<arg>--pinentry-mode</arg>
106+
<arg>loopback</arg>
107+
</gpgArguments>
108+
</configuration>
109+
</plugin>
110+
<plugin>
111+
<!-- Allow attaching Javadoc during releases -->
112+
<groupId>org.apache.maven.plugins</groupId>
113+
<artifactId>maven-javadoc-plugin</artifactId>
114+
<version>2.10.4</version>
115+
<configuration>
116+
<source>11</source>
117+
<detectJavaApiLink>false</detectJavaApiLink>
118+
<!-- Turn off Java 8 strict Javadoc checking -->
119+
<additionalparam>-Xdoclint:none</additionalparam>
120+
<tags>
121+
<tag>
122+
<name>notnull</name>
123+
<placement>a</placement>
124+
<head>Not null</head>
125+
</tag>
126+
<tag>
127+
<name>default</name>
128+
<placement>a</placement>
129+
<head>Default:</head>
130+
</tag>
131+
</tags>
132+
</configuration>
133+
<executions>
134+
<!-- Compress Javadoc into JAR and include that JAR when deploying. -->
135+
<execution>
136+
<id>attach-javadocs</id>
137+
<goals>
138+
<goal>jar</goal>
139+
</goals>
140+
</execution>
141+
</executions>
142+
</plugin>
143+
<plugin>
144+
<!-- Include zipped source code in releases -->
145+
<groupId>org.apache.maven.plugins</groupId>
146+
<artifactId>maven-source-plugin</artifactId>
147+
<executions>
148+
<execution>
149+
<id>attach-sources</id>
150+
<goals>
151+
<goal>jar-no-fork</goal>
152+
</goals>
153+
</execution>
154+
</executions>
155+
</plugin>
156+
<plugin>
157+
<!-- Automatically close and deploy from OSSRH -->
158+
<groupId>org.sonatype.plugins</groupId>
159+
<artifactId>nexus-staging-maven-plugin</artifactId>
160+
<version>1.6.7</version>
161+
<extensions>true</extensions>
162+
<configuration>
163+
<serverId>ossrh</serverId>
164+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
165+
<!-- Release versions will be synced to Maven Central automatically. -->
166+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
167+
</configuration>
168+
</plugin>
169+
<plugin>
170+
<groupId>org.apache.maven.plugins</groupId>
171+
<artifactId>maven-compiler-plugin</artifactId>
172+
<configuration>
173+
<source>1.8</source>
174+
<target>1.8</target>
175+
</configuration>
176+
</plugin>
177+
<plugin>
178+
<groupId>org.eluder.coveralls</groupId>
179+
<artifactId>coveralls-maven-plugin</artifactId>
180+
<version>4.3.0</version>
181+
</plugin>
62182
<plugin>
63183
<groupId>org.codehaus.mojo</groupId>
64184
<artifactId>cobertura-maven-plugin</artifactId>
@@ -68,7 +188,7 @@
68188
<format>html</format>
69189
<format>xml</format>
70190
</formats>
71-
<check/>
191+
<check />
72192
</configuration>
73193
</plugin>
74194
</plugins>

0 commit comments

Comments
 (0)