pom updates

This commit is contained in:
Diamantis Tziotzios 2022-12-13 17:35:31 +02:00
parent 2df91d0f8f
commit 47194d928b
2 changed files with 48 additions and 110 deletions

View File

@ -1,27 +1,18 @@
FROM maven:3.8.6-eclipse-temurin-17-focal
RUN apt-get update
RUN apt-get install gpg -y
ARG MAVEN_ACCOUNT_USR
ARG MAVEN_ACCOUNT_PSW
ARG REVISION
ARG MAVEN_GPG_PASSPHRASE
ARG MAVEN_GPG_KEYNAME
ARG PROFILE
ENV gpg_keyname=$MAVEN_GPG_KEYNAME
ENV gpg_passphrase=$MAVEN_GPG_PASSPHRASE
ENV server_username=$MAVEN_ACCOUNT_USR
ENV server_password=$MAVEN_ACCOUNT_PSW
COPY settings.xml /root/.m2/settings.xml
COPY keypair.asc /tmp/keypair.asc
RUN if [ "$PROFILE" = "ossrh" ]; then \
gpg --batch --import /tmp/keypair.asc; \
fi
####################################### Build stage #######################################
FROM maven:3.6.3-openjdk-11-slim AS build-stage
COPY . /build/
WORKDIR /build/
RUN mvn clean package -DskipTests
COPY . .
ARG CREPO_BINARIES_REPO_URL
ARG CREPO_BINARIES_CREDENTIAL
ARG BUILD_VERSION
ENV CREPO_BINARIES_REPO_URL=$CREPO_BINARIES_REPO_URL
ENV CREPO_BINARIES_CREDENTIAL=$CREPO_BINARIES_CREDENTIAL
ENV BUILD_VERSION=$BUILD_VERSION
RUN mvn -Drevision=${REVISION} -P${PROFILE} clean deploy
RUN curl --location --request PUT "${CREPO_BINARIES_REPO_URL}opendmp/repository-jars/dataverse/dataverse-deposit-${BUILD_VERSION}.jar" \
--header "Authorization: Basic ${CREPO_BINARIES_CREDENTIAL}" \
--header "Content-Type: application/json" \
--data-binary "@/build/target/repositorydepositdataverse-1.0.0-SNAPSHOT.jar"

121
pom.xml
View File

@ -91,93 +91,40 @@
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<excludes>
<exclude>eu.eudat.depositinterface.dataverserepository.config.*</exclude>
<exclude>eu.eudat.depositinterface.dataverserepository.interfaces.*</exclude>
</excludes>
<pattern></pattern>
<shadedPattern>dataverserepository.shaded.</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>eu/eudat/depositinterface/repository/**</exclude>
<exclude>eu/eudat/depositinterface/models/**</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>ossrh</id>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<createChecksum>true</createChecksum>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<id>javadoc-generation</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>javadoc</classifier>
<excludes>
<exclude>gr/**</exclude>
</excludes>
<includes>
<include>README.txt</include>
</includes>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
</execution>
<execution>
<id>sources-generation</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>sources</classifier>
<excludes>
<exclude>gr/**</exclude>
</excludes>
<includes>
<include>README.txt</include>
</includes>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>