Skip to content

Commit 1923c5c

Browse files
authored
Feature/publish to artifactory (#24)
* Using Artifactory as a default maven repository * Added Artifactory to the Github actions scripts
1 parent c3820f7 commit 1923c5c

File tree

4 files changed

+61
-9
lines changed

4 files changed

+61
-9
lines changed

.github/workflows/maven-publish.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ jobs:
2525
run: mvn -B package --file jwildcard/pom.xml
2626

2727
- name: Publish to GitHub Packages Apache Maven
28-
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml --file jwildcard/pom.xml
28+
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml --file jwildcard/pom.xml -P github
2929
env:
3030
GITHUB_TOKEN: ${{ github.token }}
31+
32+
- name: Publish to Artifactory
33+
run: mvn deploy -s jwildcard/.mvn/local-settings.xml --file jwildcard/pom.xml
34+
env:
35+
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
36+
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ dependencies {
2626

2727
Maven <code>pom.xml</code>
2828
```xml
29+
<distributionManagement>
30+
<repository>
31+
<id>central</id>
32+
<name>a0yytejrantuj-artifactory-primary-0-releases</name>
33+
<url>https://alenon.jfrog.io/artifactory/maven-releases</url>
34+
</repository>
35+
</distributionManagement>
36+
2937
<dependency>
3038
<groupId>com.yevdo</groupId>
3139
<artifactId>jwildcard</artifactId>

jwildcard/.mvn/local-settings.xml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"
3+
xmlns="http://maven.apache.org/SETTINGS/1.1.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5+
<servers>
6+
<server>
7+
<username>${env.ARTIFACTORY_USER}</username>
8+
<password>${env.ARTIFACTORY_PASSWORD}</password>
9+
<id>central</id>
10+
</server>
11+
<server>
12+
<username>${env.ARTIFACTORY_USER}</username>
13+
<password>${env.ARTIFACTORY_PASSWORD}</password>
14+
<id>snapshots</id>
15+
</server>
16+
</servers>
17+
</settings>

jwildcard/pom.xml

+29-8
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,35 @@
1111
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1212
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1313
</properties>
14-
15-
<distributionManagement>
16-
<repository>
17-
<id>github</id>
18-
<name>GitHub Packages</name>
19-
<url>https://maven.pkg.github.com/alenon/JWildcard</url>
20-
</repository>
21-
</distributionManagement>
14+
15+
<profiles>
16+
<profile>
17+
<id>artifactory</id>
18+
<activation>
19+
<activeByDefault>true</activeByDefault>
20+
</activation>
21+
<distributionManagement>
22+
<repository>
23+
<id>central</id>
24+
<url>https://alenon.jfrog.io/artifactory/maven-releases</url>
25+
</repository>
26+
<snapshotRepository>
27+
<id>snapshots</id>
28+
<url>https://alenon.jfrog.io/artifactory/maven-snapshots</url>
29+
</snapshotRepository>
30+
</distributionManagement>
31+
</profile>
32+
<profile>
33+
<id>github</id>
34+
<distributionManagement>
35+
<repository>
36+
<id>github</id>
37+
<name>GitHub Packages</name>
38+
<url>https://maven.pkg.github.com/alenon/JWildcard</url>
39+
</repository>
40+
</distributionManagement>
41+
</profile>
42+
</profiles>
2243

2344
<dependencyManagement>
2445
<dependencies>

0 commit comments

Comments
 (0)