Skip to content

Commit 3dff43c

Browse files
committed
intoolswetrust update
1 parent e54d1ee commit 3dff43c

27 files changed

+974
-938
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "maven"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"

.github/workflows/pr-builder.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Java CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up JDK 8
18+
uses: actions/setup-java@v2
19+
with:
20+
java-version: '8'
21+
distribution: 'adopt'
22+
- name: Build with Maven
23+
run: mvn --batch-mode --update-snapshots verify
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy snapshots
2+
3+
# see https://docs.github.com/en/actions/guides/publishing-java-packages-with-maven
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
release:
12+
name: Release on Sonatype OSS
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Apache Maven Central
18+
uses: actions/setup-java@v2
19+
with:
20+
java-version: 8
21+
distribution: 'adopt'
22+
server-id: ossrh
23+
server-username: MAVEN_USERNAME
24+
server-password: MAVEN_PASSWORD
25+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
26+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
27+
28+
- name: Cache Maven packages
29+
uses: actions/cache@v2
30+
with:
31+
path: ~/.m2
32+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
33+
restore-keys: ${{ runner.os }}-m2
34+
35+
- name: Publish to Apache Maven Central
36+
run: |
37+
PROJECT_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
38+
if [[ "$PROJECT_VERSION" == *-SNAPSHOT ]]; then
39+
mvn --batch-mode -Prelease deploy
40+
else
41+
mvn --batch-mode package
42+
fi
43+
env:
44+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
45+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
46+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
47+
48+
- name: Set up Docker Buildx
49+
uses: docker/setup-buildx-action@v1
50+
51+
- name: Login to Docker Hub
52+
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
53+
54+
- name: Docker Build and Push the snapshot image
55+
run: docker buildx build --push -f Dockerfile --tag kwart/simple-syslog-server:latest .
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish
2+
3+
# https://github.com/marketplace/actions/upload-files-to-a-github-release
4+
5+
on:
6+
push:
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
build:
12+
name: Publish binaries
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Apache Maven Central
18+
uses: actions/setup-java@v2
19+
with:
20+
java-version: 8
21+
distribution: 'adopt'
22+
23+
- name: Cache Maven packages
24+
uses: actions/cache@v2
25+
with:
26+
path: ~/.m2
27+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
28+
restore-keys: ${{ runner.os }}-m2
29+
30+
- name: Maven build
31+
run: mvn --batch-mode clean install
32+
33+
- name: Upload binaries to release
34+
uses: svenstaro/upload-release-action@483c1e56f95e88835747b1c7c60581215016cbf2
35+
with:
36+
repo_token: ${{ secrets.GITHUB_TOKEN }}
37+
file: target/simple-syslog-server.jar
38+
tag: ${{ github.ref }}
39+
overwrite: true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ target/
22
.classpath
33
.project
44
.settings
5+
6+
dependency-reduced-pom.xml

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM gcr.io/distroless/java:8
2+
MAINTAINER Josef (kwart) Cacek <[email protected]>
3+
4+
COPY target/simple-syslog-server.jar /simple-syslog-server.jar
5+
ENTRYPOINT ["/usr/bin/java", "-jar", "/simple-syslog-server.jar"]
6+
EXPOSE 9898
7+
CMD ["tcp" ]

pom.xml

Lines changed: 166 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,65 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
32
<modelVersion>4.0.0</modelVersion>
43

5-
<groupId>org.jboss.test</groupId>
4+
<groupId>com.github.kwart.syslog</groupId>
65
<artifactId>simple-syslog-server</artifactId>
7-
<version>1.0-SNAPSHOT</version>
6+
<version>1.1.0-SNAPSHOT</version>
87
<packaging>jar</packaging>
98

109
<name>${project.artifactId}</name>
11-
<url>https://github.com/kwart/simple-syslog-server</url>
10+
<url>https://github.com/intoolswetrust/simple-syslog-server</url>
1211

1312
<properties>
1413
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
<version.junit>4.13.2</version.junit>
15+
<maven.compiler.source>1.8</maven.compiler.source>
16+
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
17+
<exec.mainClass>com.github.kwart.syslog.Server</exec.mainClass>
1518
</properties>
1619

1720
<build>
1821
<finalName>${project.artifactId}</finalName>
19-
<resources>
20-
<resource>
21-
<directory>src/main/java</directory>
22-
<includes>
23-
<include>**/*.java</include>
24-
</includes>
25-
</resource>
26-
<resource>
27-
<directory>src/main/resources</directory>
28-
</resource>
29-
</resources>
3022
<plugins>
31-
<plugin>
32-
<groupId>org.apache.maven.plugins</groupId>
33-
<artifactId>maven-compiler-plugin</artifactId>
34-
<version>3.1</version>
35-
<configuration>
36-
<source>1.6</source>
37-
<target>1.6</target>
38-
</configuration>
39-
</plugin>
40-
<plugin>
41-
<groupId>org.codehaus.mojo</groupId>
42-
<artifactId>exec-maven-plugin</artifactId>
43-
<version>1.2.1</version>
44-
<configuration>
45-
<mainClass>org.jboss.test.App</mainClass>
46-
</configuration>
47-
</plugin>
4823
<plugin>
4924
<groupId>org.apache.maven.plugins</groupId>
5025
<artifactId>maven-shade-plugin</artifactId>
51-
<version>2.2</version>
26+
<version>3.2.4</version>
5227
<executions>
5328
<execution>
5429
<phase>package</phase>
5530
<goals>
5631
<goal>shade</goal>
5732
</goals>
5833
<configuration>
34+
<filters>
35+
<filter>
36+
<artifact>*:*</artifact>
37+
<excludes>
38+
<exclude>META-INF/*.SF</exclude>
39+
<exclude>META-INF/*.DSA</exclude>
40+
<exclude>META-INF/*.RSA</exclude>
41+
</excludes>
42+
</filter>
43+
</filters>
5944
<transformers>
60-
<transformer
61-
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
62-
<mainClass>org.jboss.test.syslog.Server</mainClass>
45+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
46+
<mainClass>${exec.mainClass}</mainClass>
6347
</transformer>
6448
</transformers>
65-
<createDependencyReducedPom>false</createDependencyReducedPom>
6649
</configuration>
6750
</execution>
6851
</executions>
6952
</plugin>
53+
<plugin>
54+
<groupId>org.codehaus.mojo</groupId>
55+
<artifactId>exec-maven-plugin</artifactId>
56+
<version>3.0.0</version>
57+
</plugin>
58+
<plugin>
59+
<groupId>org.apache.maven.plugins</groupId>
60+
<artifactId>maven-compiler-plugin</artifactId>
61+
<version>3.8.1</version>
62+
</plugin>
7063
</plugins>
7164
</build>
7265

@@ -83,11 +76,144 @@
8376
</dependency>
8477

8578
<dependency>
86-
<!-- http://maven.apache.org/plugins/maven-surefire-plugin/examples/junit.html -->
8779
<groupId>junit</groupId>
8880
<artifactId>junit</artifactId>
89-
<version>4.8.1</version>
81+
<version>${version.junit}</version>
9082
<scope>test</scope>
9183
</dependency>
9284
</dependencies>
85+
86+
<licenses>
87+
<license>
88+
<name>The Apache License, Version 2.0</name>
89+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
90+
</license>
91+
</licenses>
92+
93+
<developers>
94+
<developer>
95+
<id>kwart</id>
96+
<name>Josef Cacek</name>
97+
<email>[email protected]</email>
98+
</developer>
99+
</developers>
100+
101+
<scm>
102+
<connection>scm:git:git://github.com/intoolswetrust/ldap-server.git</connection>
103+
<developerConnection>scm:git:[email protected]:intoolswetrust/ldap-server.git</developerConnection>
104+
<url>http://github.com/intoolswetrust/ldap-server/</url>
105+
<tag>HEAD</tag>
106+
</scm>
107+
108+
<distributionManagement>
109+
<snapshotRepository>
110+
<id>ossrh</id>
111+
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
112+
</snapshotRepository>
113+
<repository>
114+
<id>ossrh</id>
115+
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
116+
</repository>
117+
</distributionManagement>
118+
119+
<repositories>
120+
<repository>
121+
<id>snapshot-repository</id>
122+
<name>Maven2 Snapshot Repository</name>
123+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
124+
<releases>
125+
<enabled>false</enabled>
126+
</releases>
127+
<snapshots>
128+
<enabled>true</enabled>
129+
</snapshots>
130+
</repository>
131+
</repositories>
132+
133+
<profiles>
134+
<profile>
135+
<id>release</id>
136+
<build>
137+
<plugins>
138+
<plugin>
139+
<groupId>org.sonatype.plugins</groupId>
140+
<artifactId>nexus-staging-maven-plugin</artifactId>
141+
<version>1.6.8</version>
142+
<extensions>true</extensions>
143+
<configuration>
144+
<serverId>ossrh</serverId>
145+
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
146+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
147+
</configuration>
148+
</plugin>
149+
<plugin>
150+
<groupId>org.apache.maven.plugins</groupId>
151+
<artifactId>maven-source-plugin</artifactId>
152+
<version>3.2.1</version>
153+
<executions>
154+
<execution>
155+
<goals>
156+
<goal>jar-no-fork</goal>
157+
</goals>
158+
</execution>
159+
</executions>
160+
</plugin>
161+
<plugin>
162+
<groupId>org.apache.maven.plugins</groupId>
163+
<artifactId>maven-javadoc-plugin</artifactId>
164+
<version>3.3.0</version>
165+
<executions>
166+
<execution>
167+
<goals>
168+
<goal>jar</goal>
169+
</goals>
170+
</execution>
171+
</executions>
172+
<configuration>
173+
<doclint>none</doclint>
174+
</configuration>
175+
</plugin>
176+
<plugin>
177+
<groupId>org.apache.maven.plugins</groupId>
178+
<artifactId>maven-gpg-plugin</artifactId>
179+
<version>3.0.1</version>
180+
<executions>
181+
<execution>
182+
<phase>verify</phase>
183+
<goals>
184+
<goal>sign</goal>
185+
</goals>
186+
</execution>
187+
</executions>
188+
<configuration>
189+
<gpgArguments>
190+
<gpgArgument>--pinentry-mode</gpgArgument>
191+
<gpgArgument>loopback</gpgArgument>
192+
</gpgArguments>
193+
</configuration>
194+
</plugin>
195+
<plugin>
196+
<artifactId>maven-enforcer-plugin</artifactId>
197+
<executions>
198+
<execution>
199+
<id>enforce-java</id>
200+
<goals>
201+
<goal>enforce</goal>
202+
</goals>
203+
<phase>compile</phase>
204+
<configuration>
205+
<rules>
206+
<requireJavaVersion>
207+
<version>[1.8,1.9)</version>
208+
</requireJavaVersion>
209+
</rules>
210+
</configuration>
211+
</execution>
212+
</executions>
213+
</plugin>
214+
</plugins>
215+
</build>
216+
</profile>
217+
</profiles>
218+
93219
</project>

0 commit comments

Comments
 (0)