Commit 4859a8ea authored by Matija Obreza's avatar Matija Obreza
Browse files

Publish artifacts on Maven Central

parent 765864be
Pipeline #1217 passed with stage
in 1 minute and 18 seconds
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>${env.OSSRH_USER}</username>
<password>${env.OSSRH_PASS}</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>${env.GPG_EXECUTABLE}</gpg.executable>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
image: maven:3-jdk-8 stages:
- build
build: run tests in branches:
script: "mvn install -B" stage: build
image: maven:3-jdk-8
script:
- MAVEN_OPTS="${MAVEN_OPTS} -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" mvn test -B
except:
- master
- tags
artifacts: publish maven snapshot artifacts:
paths: stage: build
- geotools-cli/target/geotools-cli*.jar image: maven:3-jdk-8
- geotools-cli/target/lib/*.jar script:
- echo "${GPG_KEY_SECRET}" | gpg --allow-secret-key-import --import
- gpg --list-keys
- mvn clean deploy --settings .ci-maven-settings.xml -B -U
only:
- master
publish maven artifacts:
stage: build
image: maven:3-jdk-8
script:
- echo "${GPG_KEY_SECRET}" | gpg --allow-secret-key-import --import
- gpg --list-keys
- mvn clean deploy --settings .ci-maven-settings.xml -B -U -Prelease
only:
- tags
...@@ -124,4 +124,71 @@ ...@@ -124,4 +124,71 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<profiles>
<profile>
<id>release</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<distributionManagement>
<repository>
<id>ossrh</id>
<name>Sonatype Releases</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<uniqueVersion>true</uniqueVersion>
</snapshotRepository>
</distributionManagement>
</project> </project>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment