Skip to content

Commit

Permalink
Add separate profiles for nexus and github
Browse files Browse the repository at this point in the history
  • Loading branch information
Skaar, Bjørn-Andre committed Jan 12, 2024
1 parent 358d1c6 commit 95658c3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

# Build only klass-forvaltning with JDK 1.8
- name: Build, test and package with Maven
run: mvn --batch-mode --update-snapshots package -Djava.version=1.8 -pl :klass-forvaltning -am -P nexus
run: mvn --batch-mode --update-snapshots package -Djava.version=1.8 -pl :klass-forvaltning -am -P github

deploy:
runs-on: ubuntu-latest
Expand Down
49 changes: 37 additions & 12 deletions klass-forvaltning/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<packaging>war</packaging>

<properties>
<maven.deploy.skip>false</maven.deploy.skip>
<java.version>1.8</java.version>
<github.repository>statisticsnorway/klass</github.repository>
<!-- Klass dependencies are built with support for Java 8 and Spring Boot 1.4.4.
Newer versions are not supported -->
<klass-version>2.1.7</klass-version>
Expand Down Expand Up @@ -186,18 +186,43 @@
</dependency>
</dependencies>
</dependencyManagement>
<distributionManagement>
<repository>
<id>releases</id>
<url>https://nexus.ssb.no/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>https://nexus.ssb.no/repository/maven-snapshots</url>
<uniqueVersion>false</uniqueVersion>
</snapshotRepository>
</distributionManagement>
<profiles>
<profile>
<id>nexus</id>
<distributionManagement>
<repository>
<id>releases</id>
<url>https://nexus.ssb.no/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>https://nexus.ssb.no/repository/maven-snapshots</url>
<uniqueVersion>false</uniqueVersion>
</snapshotRepository>
</distributionManagement>

<repositories>
<repository>
<id>ssb-repo</id>
<name>Nexus</name>
<url>https://nexus.ssb.no/repository/maven-public</url>
</repository>
</repositories>
</profile>
<profile>
<id>github</id>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/${github.repository}</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</distributionManagement>
</profile>
</profiles>

<build>
<finalName>klass#admin-${project.version}</finalName>
Expand Down

0 comments on commit 95658c3

Please sign in to comment.