Skip to content

Commit df7feea

Browse files
committed
Use normal deploy plugin instead of jreleaser
1 parent 99d789c commit df7feea

File tree

6 files changed

+80
-84
lines changed

6 files changed

+80
-84
lines changed

.github/workflows/early-access.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ jobs:
5858
with:
5959
java-version: ${{ env.JAVA_VERSION }}
6060
distribution: ${{ env.JAVA_DISTRO }}
61+
server-id: ossrh
62+
server-username: MAVEN_USERNAME
63+
server-password: MAVEN_PASSWORD
6164

6265
- name: Cache Maven
6366
uses: actions/cache@v4
@@ -67,18 +70,19 @@ jobs:
6770
restore-keys: ${{ runner.os }}-m2
6871

6972
- name: Build
70-
run: ./mvnw -ntp -B --file pom.xml verify
73+
run: ./mvnw -Ppublication -ntp -B --file pom.xml verify
7174

7275
- name: Deploy
7376
run: |
7477
mkdir -p ~/.m2
75-
echo "<settings><servers><server><id>ossrh</id><username>${NEXUS2_USERNAME}</username><password>${NEXUS2_PASSWORD}</password></server></servers></settings>" > ~/.m2/settings.xml
78+
echo $SETTINGS_FILE > ~/.m2/settings.xml
7679
mvn -ntp -B clean deploy
7780
env:
78-
NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
79-
NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
81+
MAVEN_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
82+
MAVEN_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
8083
SIGN_KEY_PASS: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
8184
SIGN_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
8285
GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
8386
SIGN_KEY_ID: ${{ secrets.GPG_KEY_NAME }}
84-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
SETTINGS_FILE: ${{ secrets.SETTINGS_FILE }}

.github/workflows/release.yml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,20 @@ jobs:
5757
- name: Build
5858
run: ./mvnw -ntp -B --file pom.xml verify
5959

60-
- name: Release
61-
uses: jreleaser/release-action@v2
62-
with:
63-
arguments: full-release
64-
env:
65-
JRELEASER_PROJECT_VERSION: ${{ needs.precheck.outputs.VERSION }}
66-
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
67-
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
68-
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
69-
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
70-
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
71-
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
- name: Build
61+
run: ./mvnw -Ppublication -ntp -B --file pom.xml verify
7262

73-
- name: JReleaser output
74-
if: always()
75-
uses: actions/upload-artifact@v3
76-
with:
77-
name: jreleaser-release
78-
path: |
79-
out/jreleaser/trace.log
80-
out/jreleaser/output.properties
63+
- name: Deploy
64+
run: |
65+
mkdir -p ~/.m2
66+
echo $SETTINGS_FILE > ~/.m2/settings.xml
67+
mvn -ntp -B clean deploy
68+
env:
69+
MAVEN_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
70+
MAVEN_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
71+
SIGN_KEY_PASS: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
72+
SIGN_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
73+
GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
74+
SIGN_KEY_ID: ${{ secrets.GPG_KEY_NAME }}
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
SETTINGS_FILE: ${{ secrets.SETTINGS_FILE }}

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,34 @@ b.trace_print()
146146

147147
You can use the `debug.sh` to run an example with a debugger port open at port 5005.
148148

149+
Usage as a library
150+
------------------
151+
The library is available as a Maven package:
152+
153+
```xml
154+
<dependency>
155+
<groupId>me.bechberger</groupId>
156+
<artifactId>hello-ebpf</artifactId>
157+
<version>0.1.0-SNAPSHOT</version>
158+
</dependency>
159+
```
160+
161+
You might have to add the https://s01.oss.sonatype.org/content/repositories/releases/ repo:
162+
```xml
163+
<repositories>
164+
<repository>
165+
<id>snapshots</id>
166+
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
167+
<releases>
168+
<enabled>false</enabled>
169+
</releases>
170+
<snapshots>
171+
<enabled>true</enabled>
172+
</snapshots>
173+
</repository>
174+
</repositories>
175+
```
176+
149177
Blog Posts
150178
----------
151179
Posts covering the development of this project:

bcc/pom.xml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -73,36 +73,6 @@
7373
</execution>
7474
</executions>
7575
</plugin>
76-
<plugin>
77-
<groupId>org.apache.maven.plugins</groupId>
78-
<artifactId>maven-source-plugin</artifactId>
79-
<version>2.2.1</version>
80-
<executions>
81-
<execution>
82-
<id>attach-sources</id>
83-
<goals>
84-
<goal>jar-no-fork</goal>
85-
</goals>
86-
</execution>
87-
</executions>
88-
</plugin>
89-
<plugin>
90-
<groupId>org.apache.maven.plugins</groupId>
91-
<artifactId>maven-javadoc-plugin</artifactId>
92-
<version>3.4.1</version>
93-
<executions>
94-
<execution>
95-
<id>attach-javadoc</id>
96-
<phase>deploy</phase>
97-
<goals>
98-
<goal>jar</goal>
99-
</goals>
100-
</execution>
101-
</executions>
102-
<configuration>
103-
<additionalJOption>-Xdoclint:none</additionalJOption>
104-
</configuration>
105-
</plugin>
10676
</plugins>
10777
</build>
10878

bcc/src/main/java/me/bechberger/ebpf/bcc/BPF.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ private BPF(String text, String fileName, @Nullable Path hdrFile, boolean allowR
142142
cflags_array, len(cflags_array),
143143
allow_rlimit, device)
144144
*/
145-
var maybeModule = bpf_module_create_c_from_string(arena, textNative, -1, MemorySegment.NULL, 0, allowRLimit ? 1 : 0, MemorySegment.NULL);
145+
var maybeModule = bpf_module_create_c_from_string(arena, textNative, debug, MemorySegment.NULL, 0, allowRLimit ? 1 : 0, MemorySegment.NULL);
146146
if (maybeModule.err() != 0 && maybeModule.err() != 2) {
147147
throw new BPFCallException(STR."Failed to compile BPF module: \{PanamaUtil.errnoString(maybeModule.err())}");
148148
}

pom.xml

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -48,30 +48,6 @@
4848
<forkCount>1</forkCount>
4949
</configuration>
5050
</plugin>
51-
<plugin>
52-
<groupId>org.apache.maven.plugins</groupId>
53-
<artifactId>maven-deploy-plugin</artifactId>
54-
<version>2.8.2</version>
55-
<executions>
56-
<execution>
57-
<id>default-deploy</id>
58-
<phase>deploy</phase>
59-
<goals>
60-
<goal>deploy</goal>
61-
</goals>
62-
<configuration>
63-
<skip>true</skip>
64-
</configuration>
65-
</execution>
66-
<execution>
67-
<id>release</id>
68-
<phase>deploy</phase>
69-
<goals>
70-
<goal>deploy</goal>
71-
</goals>
72-
</execution>
73-
</executions>
74-
</plugin>
7551
</plugins>
7652
</build>
7753

@@ -84,9 +60,34 @@
8460
<build>
8561
<defaultGoal>deploy</defaultGoal>
8662
<plugins>
63+
<plugin>
64+
<groupId>org.apache.maven.plugins</groupId>
65+
<artifactId>maven-deploy-plugin</artifactId>
66+
<version>3.1.1</version>
67+
<executions>
68+
<execution>
69+
<id>default-deploy</id>
70+
<phase>deploy</phase>
71+
<goals>
72+
<goal>deploy</goal>
73+
</goals>
74+
<configuration>
75+
<skip>true</skip>
76+
</configuration>
77+
</execution>
78+
<execution>
79+
<id>release</id>
80+
<phase>deploy</phase>
81+
<goals>
82+
<goal>deploy</goal>
83+
</goals>
84+
</execution>
85+
</executions>
86+
</plugin>
8787
<plugin>
8888
<groupId>org.apache.maven.plugins</groupId>
8989
<artifactId>maven-javadoc-plugin</artifactId>
90+
<version>3.6.3</version>
9091
<executions>
9192
<execution>
9293
<id>attach-javadocs</id>
@@ -95,15 +96,12 @@
9596
</goals>
9697
<configuration>
9798
<attach>true</attach>
98-
<additionalJOption>-Xdoclint:none</additionalJOption>
99-
<release>21</release>
100-
<additionalOptions>--enable-preview</additionalOptions>
10199
</configuration>
102100
</execution>
103101
</executions>
104102
<configuration>
105103
<release>21</release>
106-
<additionalOptions>--enable-preview</additionalOptions>
104+
<additionalOptions>--enable-preview -Xdoclint:none</additionalOptions>
107105
</configuration>
108106
</plugin>
109107
<plugin>

0 commit comments

Comments
 (0)