You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-5Lines changed: 31 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ This action sets up a java environment for use in actions by:
13
13
14
14
See [action.yml](action.yml)
15
15
16
-
Basic:
16
+
## Basic
17
17
```yaml
18
18
steps:
19
19
- uses: actions/checkout@v1
@@ -25,7 +25,7 @@ steps:
25
25
- run: java -cp java HelloWorldApp
26
26
```
27
27
28
-
From local file:
28
+
## Local file
29
29
```yaml
30
30
steps:
31
31
- uses: actions/checkout@v1
@@ -37,7 +37,7 @@ steps:
37
37
- run: java -cp java HelloWorldApp
38
38
```
39
39
40
-
Matrix Testing:
40
+
## Matrix Testing
41
41
```yaml
42
42
jobs:
43
43
build:
@@ -56,7 +56,7 @@ jobs:
56
56
- run: java -cp java HelloWorldApp
57
57
```
58
58
59
-
Publishing using Apache Maven:
59
+
## Publishing using Apache Maven
60
60
```yaml
61
61
jobs:
62
62
build:
@@ -91,7 +91,7 @@ jobs:
91
91
92
92
See the help docs on [Publishing a Package](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#publishing-a-package) for more information on the `pom.xml` file.
93
93
94
-
Publishing using Gradle:
94
+
## Publishing using Gradle
95
95
```yaml
96
96
jobs:
97
97
@@ -118,6 +118,32 @@ jobs:
118
118
119
119
See the help docs on [Publishing a Package with Gradle](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-gradle-for-use-with-github-packages#example-using-gradle-groovy-for-a-single-package-in-a-repository) for more information on the `build.gradle` configuration file.
120
120
121
+
## Apache Maven within a Shared Runner
122
+
123
+
When using an Actions shared runner the default `$HOME` directory can be shared by a number of workflows at the same time which could overwrite existing settings file. Setting the `m2-home` variable allows you to choose a unique location for your settings file.
124
+
125
+
```yaml
126
+
jobs:
127
+
build:
128
+
129
+
runs-on: ubuntu-latest
130
+
131
+
steps:
132
+
- uses: actions/checkout@v1
133
+
- name: Set up JDK 1.8 for Shared Runner
134
+
uses: actions/setup-java@v1
135
+
with:
136
+
java-version: 1.8
137
+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
138
+
username: ${{ github.actor }} # username for server authentication
139
+
password: ${{ github.token }} # password or token for authentication
140
+
m2-home: ${{ $GITHUB_WORKSPACE }} # location of the .m2 directory
141
+
- name: Build with Maven
142
+
run: mvn -B package --file pom.xml
143
+
- name: Publish to GitHub Packages Apache Maven
144
+
run: mvn deploy
145
+
```
146
+
121
147
# License
122
148
123
149
The scripts and documentation in this project are released under the [MIT License](LICENSE)
0 commit comments