Testing Maven deployment

This commit is contained in:
Francesco 2023-09-28 09:11:17 +02:00
parent e05b03f0ef
commit d264a5166a
4 changed files with 101 additions and 16 deletions

26
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Publish package to the Maven Central Repository
on:
push:
tags:
- v*
pull_request:
branches: [ main ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Publish package
env:
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./mvnw -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::file:./target/staging-deploy

89
pom.xml
View File

@ -17,6 +17,67 @@
<properties>
<java.version>17</java.version>
</properties>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.jreleaser</groupId>
<artifactId>jreleaser-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<jreleaser>
<signing>
<active>ALWAYS</active>
<armored>true</armored>
</signing>
<deploy>
<maven>
<nexus2>
<maven-central>
<active>ALWAYS</active>
<url>https://s01.oss.sonatype.org/service/local</url>
<closeRepository>false</closeRepository>
<releaseRepository>false</releaseRepository>
<stagingRepositories>target/staging-deploy</stagingRepositories>
</maven-central>
</nexus2>
</maven>
</deploy>
</jreleaser>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>attach-javadoc</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-source</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.atteo/evo-inflector -->
<dependency>
@ -25,12 +86,12 @@
<version>1.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tika/tika-parsers -->
<!-- <dependency> -->
<!-- <groupId>org.apache.tika</groupId> -->
<!-- <artifactId>tika-parsers</artifactId> -->
<!-- <version>2.9.0</version> -->
<!-- <type>pom</type> -->
<!-- </dependency> -->
<!-- <dependency> -->
<!-- <groupId>org.apache.tika</groupId> -->
<!-- <artifactId>tika-parsers</artifactId> -->
<!-- <version>2.9.0</version> -->
<!-- <type>pom</type> -->
<!-- </dependency> -->
<!-- https://mvnrepository.com/artifact/org.apache.tika/tika-core -->
<dependency>
@ -88,13 +149,13 @@
</dependency>
</dependencies>
<!-- <build> -->
<!-- <plugins> -->
<!-- <plugin> -->
<!-- <groupId>org.springframework.boot</groupId> -->
<!-- <artifactId>spring-boot-maven-plugin</artifactId> -->
<!-- </plugin> -->
<!-- </plugins> -->
<!-- </build> -->
<!-- <build> -->
<!-- <plugins> -->
<!-- <plugin> -->
<!-- <groupId>org.springframework.boot</groupId> -->
<!-- <artifactId>spring-boot-maven-plugin</artifactId> -->
<!-- </plugin> -->
<!-- </plugins> -->
<!-- </build> -->
</project>

View File

@ -36,7 +36,6 @@ public class GlobalController {
/**
* The baseUrl as specified in the properties file by the user
* @param request
* @return
*/
@ModelAttribute("baseUrl")

View File

@ -256,7 +256,6 @@ public class DbAdminRepository {
* Delete a specific object
* @param schema
* @param id
* @return
*/
@SuppressWarnings("unchecked")
@Transactional("transactionManager")