Skip to content

Commit e5c9dbd

Browse files
authored
1 parent c9700db commit e5c9dbd

File tree

5 files changed

+59
-50
lines changed

5 files changed

+59
-50
lines changed

.github/workflows/maven.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
# This workflow will build a Java project with Maven
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3-
43
name: Build and Deploy the main branch
5-
64
on:
75
push:
86
branches: [ main ]
97

108
jobs:
119
build:
12-
1310
runs-on: ubuntu-latest
14-
1511
steps:
16-
- uses: actions/checkout@v4
17-
- name: Set up JDK 8 and Maven Central Repository
12+
- name: Checkout the code
13+
uses: actions/checkout@v4
14+
- name: Set up JDK 8
1815
uses: actions/setup-java@v4
1916
with:
2017
java-version: '8'
@@ -26,20 +23,19 @@ jobs:
2623
deploy:
2724
needs: build
2825
runs-on: ubuntu-latest
29-
3026
steps:
31-
- uses: actions/checkout@v4
32-
- name: Set up JDK 8 and Maven Central Repository
33-
uses: actions/setup-java@v2
27+
- name: Checkout the code
28+
uses: actions/checkout@v4
29+
- name: Set up JDK 8
30+
uses: actions/setup-java@v4
3431
with:
3532
java-version: '8'
3633
distribution: 'adopt'
3734
cache: 'maven'
38-
server-id: sonatype-nexus-snapshots
39-
server-username: MAVEN_USERNAME
40-
server-password: MAVEN_PASSWORD
35+
- name: Create Maven settings.xml
36+
37+
with:
38+
githubServer: false
39+
servers: '[{"id": "central", "username": "${{ secrets.CENTRAL_USERNAME }}", "password": "${{ secrets.CENTRAL_TOKEN }}"}]'
4140
- name: Deploy with Maven
4241
run: mvn deploy -DskipTests
43-
env:
44-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
45-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

.github/workflows/pr.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
# This workflow will build a Java project with Maven
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3-
43
name: Build Pull Requests
5-
64
on: [pull_request]
75

86
jobs:
97
build:
10-
118
runs-on: ubuntu-latest
12-
139
steps:
14-
- uses: actions/checkout@v4
15-
- name: Set up JDK 8 and Maven Central Repository
10+
- name: Checkout the code
11+
uses: actions/checkout@v4
12+
- name: Set up JDK 8
1613
uses: actions/setup-java@v4
1714
with:
1815
java-version: '8'

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,23 @@ For example, here is how to import the Transport Client to your project (depreca
132132
</dependency>
133133
```
134134

135+
If you are using a SNAPSHOT version of elasticsearch-beyonder, you need to add the Sonatype repository to your `pom.xml` file:
136+
137+
```xml
138+
<repositories>
139+
<repository>
140+
<name>Central Portal Snapshots</name>
141+
<id>central-portal-snapshots</id>
142+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
143+
<releases>
144+
<enabled>false</enabled>
145+
</releases>
146+
<snapshots>
147+
<enabled>true</enabled>
148+
</snapshots>
149+
</repository>
150+
</repositories>
151+
```
135152

136153
Adding Beyonder to your client
137154
------------------------------

pom.xml

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -54,35 +54,7 @@
5454
<url>https://github.com/dadoonet/elasticsearch-beyonder/issues/</url>
5555
</issueManagement>
5656

57-
<distributionManagement>
58-
<snapshotRepository>
59-
<id>sonatype-nexus-snapshots</id>
60-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
61-
</snapshotRepository>
62-
<repository>
63-
<id>sonatype-nexus-staging</id>
64-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
65-
</repository>
66-
</distributionManagement>
67-
6857
<repositories>
69-
<!-- This repository is used to test with x-pack -->
70-
<repository>
71-
<id>elastic-download-service</id>
72-
<name>Elastic Download Service</name>
73-
<url>https://artifacts.elastic.co/maven/</url>
74-
<releases><enabled>true</enabled></releases>
75-
<snapshots><enabled>false</enabled></snapshots>
76-
</repository>
77-
78-
<repository>
79-
<id>oss-snapshots</id>
80-
<name>Sonatype OSS Snapshots</name>
81-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
82-
<releases><enabled>false</enabled></releases>
83-
<snapshots><enabled>true</enabled></snapshots>
84-
</repository>
85-
8658
<repository>
8759
<id>elastic-snapshots</id>
8860
<name>Elastic Snapshots</name>
@@ -255,6 +227,16 @@
255227
<pushChanges>false</pushChanges>
256228
</configuration>
257229
</plugin>
230+
<plugin>
231+
<groupId>org.sonatype.central</groupId>
232+
<artifactId>central-publishing-maven-plugin</artifactId>
233+
<version>0.7.0</version>
234+
<extensions>true</extensions>
235+
<configuration>
236+
<autoPublish>true</autoPublish>
237+
<waitUntil>published</waitUntil>
238+
</configuration>
239+
</plugin>
258240
<plugin>
259241
<groupId>org.sonatype.plugins</groupId>
260242
<artifactId>nexus-staging-maven-plugin</artifactId>

src/main/documentation/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,23 @@ For example, here is how to import the Transport Client to your project (depreca
132132
</dependency>
133133
```
134134

135+
If you are using a SNAPSHOT version of elasticsearch-beyonder, you need to add the Sonatype repository to your `pom.xml` file:
136+
137+
```xml
138+
<repositories>
139+
<repository>
140+
<name>Central Portal Snapshots</name>
141+
<id>central-portal-snapshots</id>
142+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
143+
<releases>
144+
<enabled>false</enabled>
145+
</releases>
146+
<snapshots>
147+
<enabled>true</enabled>
148+
</snapshots>
149+
</repository>
150+
</repositories>
151+
```
135152

136153
Adding Beyonder to your client
137154
------------------------------

0 commit comments

Comments
 (0)