Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish Maven artifacts

on:
push:
branches:
- 'main'

jobs:
publish-api-artifact:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Publish package
working-directory: ./api
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
plugins {
id 'java'
id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

group 'by.borge.jarl'
version '0.1.0-SNAPSHOT'
description 'Jarl JVM API'

repositories {
mavenCentral()
Expand All @@ -31,3 +33,29 @@ task lein(type: Exec) {
outputs.files "../core/target/jarl-${version}-standalone.jar"
}
tasks.compileJava.dependsOn lein

jar {
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
tasks.jar.dependsOn compileJava
tasks.publish.dependsOn jar

publishing {
publications {
jarlApi(MavenPublication) {
from components.java
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/borgeby/jarl"
credentials {
username = '_'
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
6 changes: 6 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@
<groupId>org.bitbucket.b_c</groupId>
<artifactId>jose4j</artifactId>
<version>0.9.2</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.sjf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
3 changes: 2 additions & 1 deletion core/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@
; more recent version provided by shadow-cljs
:exclusions [com.google.javascript/closure-compiler-unshaded]]
[thheller/shadow-cljs "2.20.14"]]
:source-paths ["src/main/cljs" "src/main/cljc" "src/test/cljs" "src/test/cljc"]}})
:source-paths ["src/main/cljs" "src/main/cljc" "src/test/cljs" "src/test/cljc"]}
:uberjar {:uberjar-exclusions [#"org/slf4j"]}})

@fleskesvor fleskesvor Dec 9, 2024

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a transitive dependency from "org.bitbucket.b_c/jose4j", which causes an issue with my demoproject. With this exclusion, I can at least build and run my demo project successfully, but there's a huge amount of debug log noise coming from Jarl, which I haven't been able to change yet.

Ideally, I'd want to get it to work with Logback, so that I can configure something like this in my application.properties file:

logging.level.com.fleskesvor.auth_server=debug
logging.level.by.borge.jarl=info

to change the log level of my own code and Jarl independently. Actually, "info" should even be the default log level for Jarl, but even so, it would be nice to be able to configure its level easily at runtime. I'm not very familiar with this stuff, so I'll need to explore what my options are. Some quick reading suggests that log level is set at compile time with Timbre, but that can't be right.