Skip to content

Commit

Permalink
Feature/publish to artifactory (#24)
Browse files Browse the repository at this point in the history
* Using Artifactory as a default maven repository
* Added Artifactory to the Github actions scripts
  • Loading branch information
alenon committed Apr 3, 2021
1 parent c3820f7 commit 1923c5c
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 9 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ jobs:
run: mvn -B package --file jwildcard/pom.xml

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml --file jwildcard/pom.xml
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml --file jwildcard/pom.xml -P github
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Publish to Artifactory
run: mvn deploy -s jwildcard/.mvn/local-settings.xml --file jwildcard/pom.xml
env:
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ dependencies {

Maven <code>pom.xml</code>
```xml
<distributionManagement>
<repository>
<id>central</id>
<name>a0yytejrantuj-artifactory-primary-0-releases</name>
<url>https://alenon.jfrog.io/artifactory/maven-releases</url>
</repository>
</distributionManagement>

<dependency>
<groupId>com.yevdo</groupId>
<artifactId>jwildcard</artifactId>
Expand Down
17 changes: 17 additions & 0 deletions jwildcard/.mvn/local-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"
xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>${env.ARTIFACTORY_USER}</username>
<password>${env.ARTIFACTORY_PASSWORD}</password>
<id>central</id>
</server>
<server>
<username>${env.ARTIFACTORY_USER}</username>
<password>${env.ARTIFACTORY_PASSWORD}</password>
<id>snapshots</id>
</server>
</servers>
</settings>
37 changes: 29 additions & 8 deletions jwildcard/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,35 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/alenon/JWildcard</url>
</repository>
</distributionManagement>

<profiles>
<profile>
<id>artifactory</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<distributionManagement>
<repository>
<id>central</id>
<url>https://alenon.jfrog.io/artifactory/maven-releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>https://alenon.jfrog.io/artifactory/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
</profile>
<profile>
<id>github</id>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/alenon/JWildcard</url>
</repository>
</distributionManagement>
</profile>
</profiles>

<dependencyManagement>
<dependencies>
Expand Down

0 comments on commit 1923c5c

Please sign in to comment.