Skip to content

Commit 8f9ead7

Browse files
author
Camilo Molina Orth
committed
feat: add base controller and common web domain objects
1 parent e4fcd98 commit 8f9ead7

File tree

10 files changed

+445
-15
lines changed

10 files changed

+445
-15
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Java CI with Maven and SonarCloud
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
build-and-analyze:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0 # Necessary for a comprehensive SonarCloud analysis
18+
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v3
21+
with:
22+
java-version: '17'
23+
distribution: 'zulu'
24+
25+
- name: Cache Maven and SonarCloud packages
26+
uses: actions/cache@v3
27+
with:
28+
path: |
29+
~/.m2
30+
~/.sonar/cache
31+
key: ${{ runner.os }}-m2-sonar-${{ hashFiles('**/pom.xml') }}
32+
33+
- name: Build and analyze with Maven
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
37+
run: mvn -B verify --file pom.xml org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -PcoverageReport
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Maven Library Publish
2+
3+
on:
4+
release:
5+
types: [ created ]
6+
7+
jobs:
8+
publish:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up JDK 17 for deploy to Sonatype
16+
uses: actions/setup-java@v3
17+
with:
18+
distribution: 'adopt'
19+
java-version: 17
20+
server-id: central
21+
server-username: MAVEN_USERNAME
22+
server-password: MAVEN_CENTRAL_TOKEN
23+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
24+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
25+
26+
- name: Build with Maven
27+
run: mvn -B package --file pom.xml
28+
29+
- name: Prepare Maven environnement with Java 17 for deployment to Sonatype
30+
run: export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
31+
32+
- name: Publish to Apache Maven Central
33+
run: mvn deploy -PsonatypeDeploy
34+
env:
35+
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
36+
MAVEN_CENTRAL_TOKEN: ${{ secrets.NEXUS_PASSWORD }}
37+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

.gitignore

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
1-
target/
2-
pom.xml.tag
3-
pom.xml.releaseBackup
4-
pom.xml.versionsBackup
5-
pom.xml.next
6-
release.properties
7-
dependency-reduced-pom.xml
8-
buildNumber.properties
9-
.mvn/timing.properties
10-
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
11-
.mvn/wrapper/maven-wrapper.jar
1+
### IntelliJ IDEA ###
2+
out/
3+
!**/src/main/**/out/
4+
!**/src/test/**/out/
5+
.idea/
126

13-
# Eclipse m2e generated files
14-
# Eclipse Core
15-
.project
16-
# JDT-specific (Eclipse Java Development Tools)
7+
### Eclipse ###
8+
.apt_generated
179
.classpath
10+
.factorypath
11+
.project
12+
.settings
13+
.springBeans
14+
.sts4-cache
15+
bin/
16+
!**/src/main/**/bin/
17+
!**/src/test/**/bin/
18+
19+
### NetBeans ###
20+
/nbproject/private/
21+
/nbbuild/
22+
/dist/
23+
/nbdist/
24+
/.nb-gradle/
25+
26+
### VS Code ###
27+
.vscode/
28+
29+
### Mac OS ###
30+
.DS_Store
31+
32+
### maven ??###
33+
target

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2010 Bennu SpA Authors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Bennu SpringBoot-Commons
2+
===================
3+
4+
[![Maven Central](https://img.shields.io/maven-central/v/cl.bennu/spring-boot-commons?label=Maven%20Central&logo=sonatype)](https://search.maven.org/artifact/cl.bennu/spring-boot-commons)
5+
[![License](https://img.shields.io/github/license/bennu/mybatis-commons?label=License&logo=opensourceinitiative)](https://opensource.org/license/mit-0)
6+
[![Supported JVM Versions](https://img.shields.io/badge/JVM-17--21-brightgreen.svg?label=JVM&logo=openjdk)](https://adoptium.net/es/temurin/releases/)
7+
8+
Bennu MyBatis-Commons, a package of Java utility classes for
9+
classes that are repeated in our mybatis projects.
10+
11+
The code is tested using the latest revision of the JDK for supported
12+
LTS releases: 17 and 21.
13+
14+
```xml
15+
<dependency>
16+
<groupId>cl.bennu</groupId>
17+
<artifactId>spring-boot-commons</artifactId>
18+
<version>0.0.1</version>
19+
</dependency>
20+
```
21+
22+
Building
23+
--------
24+
25+
Building requires a Java JDK and [Apache Maven](https://maven.apache.org/).
26+
The required Java version is found in the `pom.xml` as the `maven.compiler.source` property.
27+
28+
From a command shell, run `mvn` without arguments to invoke the default Maven goal to run all tests and checks.
29+
30+
License
31+
-------
32+
33+
This code is licensed under the [MIT License](https://opensource.org/license/mit).
34+
35+
Dependencies
36+
------------
37+
38+
- commons 1.2.0
39+
- spring-web 6.2.5

pom.xml

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
<?xml version="1.0"?>
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5+
6+
<modelVersion>4.0.0</modelVersion>
7+
8+
<groupId>cl.bennu</groupId>
9+
<artifactId>spring-boot-commons</artifactId>
10+
<version>0.0.1</version>
11+
<name>bennu-spring-boot-commons</name>
12+
<description>Utilitarios bennu para SpringBoot</description>
13+
<url>https://github.com/bennu/spring-boot-commons</url>
14+
15+
<licenses>
16+
<license>
17+
<name>MIT License</name>
18+
<url>http://www.opensource.org/licenses/mit-license.php</url>
19+
</license>
20+
</licenses>
21+
22+
<developers>
23+
<developer>
24+
<name>Bennu</name>
25+
<email>[email protected]</email>
26+
<url>https://bennu.cl/</url>
27+
<organization>Bennu SpA</organization>
28+
<organizationUrl>https://github.com/bennu</organizationUrl>
29+
</developer>
30+
</developers>
31+
32+
<scm>
33+
<connection>scm:git:[email protected]:bennu/spring-boot-commons.git</connection>
34+
<developerConnection>scm:git:[email protected]:bennu/spring-boot-commons.git</developerConnection>
35+
<url>[email protected]:bennu/spring-boot-commons.git</url>
36+
</scm>
37+
38+
<properties>
39+
<java.version>17</java.version>
40+
<maven.compiler.release>17</maven.compiler.release>
41+
<maven.compiler.source>17</maven.compiler.source>
42+
<maven.compiler.target>17</maven.compiler.target>
43+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
44+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
45+
</properties>
46+
47+
<dependencies>
48+
<dependency>
49+
<groupId>cl.bennu</groupId>
50+
<artifactId>commons</artifactId>
51+
<version>1.2.0</version>
52+
</dependency>
53+
54+
<dependency>
55+
<groupId>org.springframework</groupId>
56+
<artifactId>spring-web</artifactId>
57+
<version>6.2.5</version>
58+
</dependency>
59+
</dependencies>
60+
61+
<profiles>
62+
<profile>
63+
<!-- required, used in .github/workflows/sonatype-publish.yml -->
64+
<id>sonatypeDeploy</id>
65+
<build>
66+
<plugins>
67+
<plugin>
68+
<groupId>org.sonatype.central</groupId>
69+
<artifactId>central-publishing-maven-plugin</artifactId>
70+
<version>0.3.0</version>
71+
<extensions>true</extensions>
72+
<configuration>
73+
<publishingServerId>central</publishingServerId>
74+
<tokenAuth>true</tokenAuth>
75+
<autoPublish>true</autoPublish>
76+
<waitUntil>published</waitUntil>
77+
</configuration>
78+
</plugin>
79+
<plugin>
80+
<groupId>org.apache.maven.plugins</groupId>
81+
<artifactId>maven-source-plugin</artifactId>
82+
<version>3.3.0</version>
83+
<executions>
84+
<execution>
85+
<id>attach-sources</id>
86+
<goals>
87+
<goal>jar-no-fork</goal>
88+
</goals>
89+
</execution>
90+
</executions>
91+
</plugin>
92+
<plugin>
93+
<groupId>org.apache.maven.plugins</groupId>
94+
<artifactId>maven-javadoc-plugin</artifactId>
95+
<version>3.6.3</version>
96+
<executions>
97+
<execution>
98+
<id>attach-javadocs</id>
99+
<goals>
100+
<goal>jar</goal>
101+
</goals>
102+
</execution>
103+
</executions>
104+
</plugin>
105+
<plugin>
106+
<groupId>org.apache.maven.plugins</groupId>
107+
<artifactId>maven-gpg-plugin</artifactId>
108+
<version>3.1.0</version>
109+
<executions>
110+
<execution>
111+
<id>sign-artifacts</id>
112+
<phase>verify</phase>
113+
<goals>
114+
<goal>sign</goal>
115+
</goals>
116+
<configuration>
117+
<gpgArguments>
118+
<arg>--pinentry-mode</arg>
119+
<arg>loopback</arg>
120+
</gpgArguments>
121+
</configuration>
122+
</execution>
123+
</executions>
124+
</plugin>
125+
</plugins>
126+
</build>
127+
</profile>
128+
<profile>
129+
<!-- optional: used in .github/workflows/build-and-analyze.yml -->
130+
<id>coverageReport</id>
131+
<build>
132+
<plugins>
133+
<plugin>
134+
<artifactId>maven-surefire-plugin</artifactId>
135+
<version>3.2.5</version>
136+
</plugin>
137+
<plugin>
138+
<groupId>org.jacoco</groupId>
139+
<artifactId>jacoco-maven-plugin</artifactId>
140+
<version>0.8.7</version>
141+
<executions>
142+
<execution>
143+
<id>prepare-agent</id>
144+
<goals>
145+
<goal>prepare-agent</goal>
146+
</goals>
147+
</execution>
148+
<execution>
149+
<id>report</id>
150+
<goals>
151+
<goal>report</goal>
152+
</goals>
153+
<configuration>
154+
<formats>
155+
<format>XML</format>
156+
</formats>
157+
</configuration>
158+
</execution>
159+
</executions>
160+
</plugin>
161+
</plugins>
162+
</build>
163+
</profile>
164+
</profiles>
165+
166+
<build>
167+
<plugins>
168+
<plugin>
169+
<groupId>org.apache.maven.plugins</groupId>
170+
<artifactId>maven-javadoc-plugin</artifactId>
171+
<version>3.10.1</version> <!-- Check for latest version at Maven Central -->
172+
<executions>
173+
<execution>
174+
<id>attach-javadocs</id>
175+
<goals>
176+
<goal>jar</goal>
177+
</goals>
178+
</execution>
179+
</executions>
180+
</plugin>
181+
<plugin>
182+
<groupId>org.apache.maven.plugins</groupId>
183+
<artifactId>maven-source-plugin</artifactId>
184+
<version>3.3.1</version> <!-- Check for latest version at Maven Central -->
185+
<executions>
186+
<execution>
187+
<id>attach-sources</id>
188+
<goals>
189+
<goal>jar-no-fork</goal>
190+
</goals>
191+
</execution>
192+
</executions>
193+
</plugin>
194+
</plugins>
195+
</build>
196+
197+
</project>

0 commit comments

Comments
 (0)