Skip to content
Merged
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
53 changes: 34 additions & 19 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven
name: Java CI (Maven & Gradle)

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B package --file pom.xml
build:
runs-on: ubuntu-latest

# Runs both Maven and Gradle builds to keep both build scripts healthy
strategy:
matrix:
build-tool: [maven, gradle]

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: ${{ matrix.build-tool }}

- name: Build with Maven
if: matrix.build-tool == 'maven'
run: mvn -B package --file pom.xml

- name: Build with Gradle
if: matrix.build-tool == 'gradle'
run: ./gradlew --no-daemon clean build
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ target
# IntelliJ #
*.iml
.idea/
.gradle/
gradle/
.gradle
gradle/*
!gradle/wrapper/
!gradle/wrapper/gradle-wrapper.jar
!gradle/wrapper/gradle-wrapper.properties

build/
libraries/
gradlew
gradlew.bat

logs/
log-test/
Expand Down
36 changes: 32 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
netconf-java
============

**A modernized Java library for NETCONF (now Java 17‑compatible)**

Java library for NETCONF

SUPPORT
Expand All @@ -13,12 +15,24 @@ or even better submit pull requests on GitHub.
REQUIREMENTS
============

[OpenJDK 8](http://openjdk.java.net/projects/jdk8/) or Java 8
[Maven](https://maven.apache.org/download.cgi) if you want to build using `mvn` [Supported from v2.1.1].
* [OpenJDK 17](https://openjdk.org/projects/jdk/17/) or later
* [Maven](https://maven.apache.org/download.cgi) if you want to build using `mvn` [Supported from v2.1.1].
* [Gradle 8+](https://gradle.org/releases/) if you prefer a Gradle build (`./gradlew build`)

[Maven](https://maven.apache.org/download.cgi) if you want to build using `mvn` [Supported from v2.1.1].
Building
========
You can build the project using **Maven** or **Gradle**.

[lombok](https://mvnrepository.com/artifact/org.projectlombok/lombok) needs to be provided by the runtime (`mvn dependency scope` is set as `provided`)
### Maven
```bash
mvn clean package
```

### Gradle
```bash
./gradlew clean build
```
(The wrapper script downloads the correct Gradle version automatically.)

Releases
========
Expand All @@ -38,6 +52,17 @@ User may download the source code and compile it with desired JDK version.

=======

v2.2.0
------
* Java 17 baseline; compiled with `--release 17`
* Gradle build added alongside Maven
* SpotBugs upgraded to 6.x
* Added **:confirmed-commit:1.1** support (`commitConfirm(timeout, persist)` and `cancelCommit(persistId)`)
* Added **killSession(String)** helper for RFC 6241 §7.9
* Auto‑inject base 1.1 capability in <hello> exchange
* Gradle wrapper committed; GitHub Actions now builds Maven *and* Gradle
* Expanded Javadoc and SpotBugs clean‑up

v2.1.1
------

Expand All @@ -59,6 +84,7 @@ Example:
Device device = Device.builder().hostName("hostname")
.userName("username")
.password("password")
.connectionTimeout(2000)
.hostKeysFileName("hostKeysFileName")
.build();
```
Expand All @@ -84,6 +110,7 @@ public class ShowInterfaces {
.hostName("hostname")
.userName("username")
.password("password")
.connectionTimeout(2000)
.hostKeysFileName("hostKeysFileName")
.build();
device.connect();
Expand Down Expand Up @@ -127,3 +154,4 @@ AUTHOR

[Ankit Jain](http://www.linkedin.com/in/ankitj093), Juniper Networks
[Peter J Hill](https://github.com/peterjhill), Oracle
[Community Contributors](https://github.com/Juniper/netconf-java/graphs/contributors)
107 changes: 107 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
plugins {
id 'java'
id 'jacoco'
id 'maven-publish'
id 'com.github.spotbugs' version '6.0.6'
}

group = 'net.juniper.netconf'
version = '2.2.0.0'
description = 'An API For NetConf client'

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withJavadocJar()
withSourcesJar()
}

repositories {
mavenCentral()
}

dependencies {
implementation 'com.jcraft:jsch:0.1.55'
implementation 'org.slf4j:slf4j-api:2.0.3'
implementation 'com.google.guava:guava:32.0.1-jre'

testImplementation 'org.hamcrest:hamcrest-all:1.3'
testImplementation 'org.assertj:assertj-core:3.23.1'
testImplementation 'org.mockito:mockito-core:4.8.1'
testImplementation 'commons-io:commons-io:2.14.0'
testImplementation 'org.xmlunit:xmlunit-assertj:2.9.0'
testImplementation 'org.slf4j:slf4j-simple:2.0.3'
testImplementation 'com.github.spotbugs:spotbugs-annotations:4.7.3'

}

testing {
suites {
test {
// Pulls in both junit-jupiter-api and -engine at version 5.11.1
useJUnitJupiter('5.11.1')
}
}
}

test {
testLogging {
events "passed", "skipped", "failed"
}
}

tasks.withType(JavaCompile).configureEach {
options.fork = true
options.forkOptions.jvmArgs += [
'--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED'
]
}

spotbugs {
ignoreFailures = true
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name.set("$group:$project.name")
description.set(project.description)
url.set("https://github.com/Juniper/netconf-java")

licenses {
license {
name.set("BSD 2")
url.set("https://opensource.org/licenses/BSD-2-Clause")
}
}

developers {
developer {
id.set("juniper")
name.set("Juniper Networks")
email.set("jnpr-community-netdev@juniper.net")
organization.set("Juniper Networks")
organizationUrl.set("https://github.com/Juniper")
}
}

scm {
connection.set("scm:git:git://github.com/Juniper/netconf-java.git")
developerConnection.set("scm:git:ssh://github.com:Juniper/netconf-java.git")
url.set("https://github.com/Juniper/netconf-java/tree/master")
}
}
}
}
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading