From 3076f4636a752375032815d74ebe9c1e703d7630 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Fri, 29 Mar 2024 10:25:44 -0300 Subject: [PATCH 1/8] Move SSH providers to separate extensions --- deployment/pom.xml | 6 +- .../ROOT/pages/includes/attributes.adoc | 2 +- pom.xml | 25 ++++- runtime/pom.xml | 13 +-- .../resources/META-INF/quarkus-extension.yaml | 2 +- ssh-factories/jsch/deployment/pom.xml | 46 +++++++++ .../jsch/deployment/JgitJschProcessor.java | 14 +++ .../jgit/jsch/test/JgitJschDevModeTest.java | 23 +++++ .../quarkus/jgit/jsch/test/JgitJschTest.java | 23 +++++ ssh-factories/jsch/integration-tests/pom.xml | 96 +++++++++++++++++++ .../jgit/jsch/it/JgitJschResource.java | 32 +++++++ .../src/main/resources/application.properties | 0 .../jgit/jsch/it/JgitJschResourceIT.java | 7 ++ .../jgit/jsch/it/JgitJschResourceTest.java | 21 ++++ ssh-factories/jsch/pom.xml | 17 ++++ ssh-factories/jsch/runtime/pom.xml | 55 +++++++++++ .../resources/META-INF/quarkus-extension.yaml | 10 ++ ssh-factories/sshd/deployment/pom.xml | 50 ++++++++++ .../sshd/deployment/JgitSshdProcessor.java | 14 +++ .../jgit/sshd/test/JgitSshdDevModeTest.java | 23 +++++ .../quarkus/jgit/sshd/test/JgitSshdTest.java | 23 +++++ ssh-factories/sshd/integration-tests/pom.xml | 96 +++++++++++++++++++ .../jgit/sshd/it/JgitSshdResource.java | 32 +++++++ .../src/main/resources/application.properties | 0 .../jgit/sshd/it/JgitSshdResourceIT.java | 7 ++ .../jgit/sshd/it/JgitSshdResourceTest.java | 21 ++++ ssh-factories/sshd/pom.xml | 17 ++++ ssh-factories/sshd/runtime/pom.xml | 60 ++++++++++++ .../resources/META-INF/quarkus-extension.yaml | 10 ++ 29 files changed, 726 insertions(+), 19 deletions(-) create mode 100644 ssh-factories/jsch/deployment/pom.xml create mode 100644 ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java create mode 100644 ssh-factories/jsch/deployment/src/test/java/io/quarkiverse/quarkus/jgit/jsch/test/JgitJschDevModeTest.java create mode 100644 ssh-factories/jsch/deployment/src/test/java/io/quarkiverse/quarkus/jgit/jsch/test/JgitJschTest.java create mode 100644 ssh-factories/jsch/integration-tests/pom.xml create mode 100644 ssh-factories/jsch/integration-tests/src/main/java/io/quarkiverse/quarkus/jgit/jsch/it/JgitJschResource.java create mode 100644 ssh-factories/jsch/integration-tests/src/main/resources/application.properties create mode 100644 ssh-factories/jsch/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/jsch/it/JgitJschResourceIT.java create mode 100644 ssh-factories/jsch/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/jsch/it/JgitJschResourceTest.java create mode 100644 ssh-factories/jsch/pom.xml create mode 100644 ssh-factories/jsch/runtime/pom.xml create mode 100644 ssh-factories/jsch/runtime/src/main/resources/META-INF/quarkus-extension.yaml create mode 100644 ssh-factories/sshd/deployment/pom.xml create mode 100644 ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JgitSshdProcessor.java create mode 100644 ssh-factories/sshd/deployment/src/test/java/io/quarkiverse/quarkus/jgit/sshd/test/JgitSshdDevModeTest.java create mode 100644 ssh-factories/sshd/deployment/src/test/java/io/quarkiverse/quarkus/jgit/sshd/test/JgitSshdTest.java create mode 100644 ssh-factories/sshd/integration-tests/pom.xml create mode 100644 ssh-factories/sshd/integration-tests/src/main/java/io/quarkiverse/quarkus/jgit/sshd/it/JgitSshdResource.java create mode 100644 ssh-factories/sshd/integration-tests/src/main/resources/application.properties create mode 100644 ssh-factories/sshd/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/sshd/it/JgitSshdResourceIT.java create mode 100644 ssh-factories/sshd/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/sshd/it/JgitSshdResourceTest.java create mode 100644 ssh-factories/sshd/pom.xml create mode 100644 ssh-factories/sshd/runtime/pom.xml create mode 100644 ssh-factories/sshd/runtime/src/main/resources/META-INF/quarkus-extension.yaml diff --git a/deployment/pom.xml b/deployment/pom.xml index f9345f0..f7560af 100644 --- a/deployment/pom.xml +++ b/deployment/pom.xml @@ -11,17 +11,13 @@ io.quarkus - quarkus-arc-deployment + quarkus-core-deployment io.quarkiverse.jgit quarkus-jgit ${project.version} - - io.quarkiverse.jsch - quarkus-jsch-deployment - diff --git a/docs/modules/ROOT/pages/includes/attributes.adoc b/docs/modules/ROOT/pages/includes/attributes.adoc index c3e234e..70ffe84 100644 --- a/docs/modules/ROOT/pages/includes/attributes.adoc +++ b/docs/modules/ROOT/pages/includes/attributes.adoc @@ -1,4 +1,4 @@ -:quarkus-version: 3.8.2 +:quarkus-version: 3.8.3 :quarkus-jgit-version: 3.1.0 :project-version: 3.1.0 :examples-dir: ./../examples/ diff --git a/pom.xml b/pom.xml index 8f1a380..2f95e79 100644 --- a/pom.xml +++ b/pom.xml @@ -16,11 +16,14 @@ runtime docs integration-tests + ssh-factories/sshd + ssh-factories/jsch - 3.8.2 + 3.8.3 6.9.0.202403050737-r 3.0.7 + 1.1.0 scm:git:git@github.com:quarkiverse/quarkus-jgit.git @@ -57,6 +60,11 @@ + + org.eclipse.jgit + org.eclipse.jgit.ssh.apache + ${jgit.version} + io.quarkiverse.jsch quarkus-jsch @@ -67,6 +75,16 @@ quarkus-jsch-deployment ${quarkus-jsch.version} + + io.quarkiverse.sshd + quarkus-sshd + ${quarkus-sshd.version} + + + io.quarkiverse.sshd + quarkus-sshd-deployment + ${quarkus-sshd.version} + @@ -77,6 +95,11 @@ quarkus-maven-plugin ${quarkus.version} + + io.quarkus + quarkus-extension-maven-plugin + ${quarkus.version} + diff --git a/runtime/pom.xml b/runtime/pom.xml index 8dcc9e0..631b1a1 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -12,23 +12,15 @@ io.quarkus - quarkus-arc - - - io.quarkiverse.jsch - quarkus-jsch + quarkus-core org.eclipse.jgit org.eclipse.jgit - - org.eclipse.jgit - org.eclipse.jgit.ssh.jsch - org.graalvm.sdk - graal-sdk + nativeimage provided @@ -37,7 +29,6 @@ io.quarkus quarkus-extension-maven-plugin - ${quarkus.version} compile diff --git a/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/runtime/src/main/resources/META-INF/quarkus-extension.yaml index 5899774..b69c080 100644 --- a/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -6,5 +6,5 @@ metadata: - "git" categories: - "miscellaneous" - guide: https://quarkiverse.github.io/quarkiverse-docs/quarkus-jgit/dev/index.html + guide: https://docs.quarkiverse.io/quarkus-jgit/dev/index.html status: "stable" diff --git a/ssh-factories/jsch/deployment/pom.xml b/ssh-factories/jsch/deployment/pom.xml new file mode 100644 index 0000000..7d39a32 --- /dev/null +++ b/ssh-factories/jsch/deployment/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + + + io.quarkiverse.jgit + quarkus-jgit-jsch-parent + 999-SNAPSHOT + + quarkus-jgit-jsch-deployment + Quarkus - JGit - SSH Providers - JSch - Deployment + + + + io.quarkiverse.jsch + quarkus-jsch-deployment + + + io.quarkiverse.jgit + quarkus-jgit-jsch + ${project.version} + + + io.quarkus + quarkus-junit5-internal + test + + + + + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${quarkus.version} + + + + + + + diff --git a/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java b/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java new file mode 100644 index 0000000..81e72f1 --- /dev/null +++ b/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java @@ -0,0 +1,14 @@ +package io.quarkiverse.quarkus.jgit.jsch.deployment; + +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.FeatureBuildItem; + +class JgitJschProcessor { + + private static final String FEATURE = "jgit-jsch"; + + @BuildStep + FeatureBuildItem feature() { + return new FeatureBuildItem(FEATURE); + } +} diff --git a/ssh-factories/jsch/deployment/src/test/java/io/quarkiverse/quarkus/jgit/jsch/test/JgitJschDevModeTest.java b/ssh-factories/jsch/deployment/src/test/java/io/quarkiverse/quarkus/jgit/jsch/test/JgitJschDevModeTest.java new file mode 100644 index 0000000..9b080db --- /dev/null +++ b/ssh-factories/jsch/deployment/src/test/java/io/quarkiverse/quarkus/jgit/jsch/test/JgitJschDevModeTest.java @@ -0,0 +1,23 @@ +package io.quarkiverse.quarkus.jgit.jsch.test; + +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.test.QuarkusDevModeTest; + +public class JgitJschDevModeTest { + + // Start hot reload (DevMode) test with your extension loaded + @RegisterExtension + static final QuarkusDevModeTest devModeTest = new QuarkusDevModeTest() + .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)); + + @Test + public void writeYourOwnDevModeTest() { + // Write your dev mode tests here - see the testing extension guide https://quarkus.io/guides/writing-extensions#testing-hot-reload for more information + Assertions.assertTrue(true, "Add dev mode assertions to " + getClass().getName()); + } +} diff --git a/ssh-factories/jsch/deployment/src/test/java/io/quarkiverse/quarkus/jgit/jsch/test/JgitJschTest.java b/ssh-factories/jsch/deployment/src/test/java/io/quarkiverse/quarkus/jgit/jsch/test/JgitJschTest.java new file mode 100644 index 0000000..3a0778d --- /dev/null +++ b/ssh-factories/jsch/deployment/src/test/java/io/quarkiverse/quarkus/jgit/jsch/test/JgitJschTest.java @@ -0,0 +1,23 @@ +package io.quarkiverse.quarkus.jgit.jsch.test; + +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.test.QuarkusUnitTest; + +public class JgitJschTest { + + // Start unit test with your extension loaded + @RegisterExtension + static final QuarkusUnitTest unitTest = new QuarkusUnitTest() + .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)); + + @Test + public void writeYourOwnUnitTest() { + // Write your unit tests here - see the testing extension guide https://quarkus.io/guides/writing-extensions#testing-extensions for more information + Assertions.assertTrue(true, "Add some assertions to " + getClass().getName()); + } +} diff --git a/ssh-factories/jsch/integration-tests/pom.xml b/ssh-factories/jsch/integration-tests/pom.xml new file mode 100644 index 0000000..f99fbd9 --- /dev/null +++ b/ssh-factories/jsch/integration-tests/pom.xml @@ -0,0 +1,96 @@ + + + 4.0.0 + + io.quarkiverse.jgit + quarkus-jgit-jsch-parent + 999-SNAPSHOT + + quarkus-jgit-jsch-integration-tests + Quarkus - JGit - SSH Providers - JSch - Integration Tests + + + true + + + + + io.quarkus + quarkus-resteasy-reactive + + + io.quarkiverse.jgit + quarkus-jgit-jsch + ${project.version} + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + + + + + io.quarkus + quarkus-maven-plugin + + + + build + + + + + + maven-failsafe-plugin + + + + integration-test + verify + + + + + + ${project.build.directory}/${project.build.finalName}-runner + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + + native-image + + + native + + + + + + maven-surefire-plugin + + ${native.surefire.skip} + + + + + + false + native + + + + diff --git a/ssh-factories/jsch/integration-tests/src/main/java/io/quarkiverse/quarkus/jgit/jsch/it/JgitJschResource.java b/ssh-factories/jsch/integration-tests/src/main/java/io/quarkiverse/quarkus/jgit/jsch/it/JgitJschResource.java new file mode 100644 index 0000000..de65eaa --- /dev/null +++ b/ssh-factories/jsch/integration-tests/src/main/java/io/quarkiverse/quarkus/jgit/jsch/it/JgitJschResource.java @@ -0,0 +1,32 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package io.quarkiverse.quarkus.jgit.jsch.it; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; + +@Path("/jgit-jsch") +@ApplicationScoped +public class JgitJschResource { + // add some rest methods here + + @GET + public String hello() { + return "Hello jgit-jsch"; + } +} diff --git a/ssh-factories/jsch/integration-tests/src/main/resources/application.properties b/ssh-factories/jsch/integration-tests/src/main/resources/application.properties new file mode 100644 index 0000000..e69de29 diff --git a/ssh-factories/jsch/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/jsch/it/JgitJschResourceIT.java b/ssh-factories/jsch/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/jsch/it/JgitJschResourceIT.java new file mode 100644 index 0000000..0860fa6 --- /dev/null +++ b/ssh-factories/jsch/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/jsch/it/JgitJschResourceIT.java @@ -0,0 +1,7 @@ +package io.quarkiverse.quarkus.jgit.jsch.it; + +import io.quarkus.test.junit.QuarkusIntegrationTest; + +@QuarkusIntegrationTest +public class JgitJschResourceIT extends JgitJschResourceTest { +} diff --git a/ssh-factories/jsch/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/jsch/it/JgitJschResourceTest.java b/ssh-factories/jsch/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/jsch/it/JgitJschResourceTest.java new file mode 100644 index 0000000..60dd29e --- /dev/null +++ b/ssh-factories/jsch/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/jsch/it/JgitJschResourceTest.java @@ -0,0 +1,21 @@ +package io.quarkiverse.quarkus.jgit.jsch.it; + +import static io.restassured.RestAssured.given; +import static org.hamcrest.Matchers.is; + +import org.junit.jupiter.api.Test; + +import io.quarkus.test.junit.QuarkusTest; + +@QuarkusTest +public class JgitJschResourceTest { + + @Test + public void testHelloEndpoint() { + given() + .when().get("/jgit-jsch") + .then() + .statusCode(200) + .body(is("Hello jgit-jsch")); + } +} diff --git a/ssh-factories/jsch/pom.xml b/ssh-factories/jsch/pom.xml new file mode 100644 index 0000000..679eeb0 --- /dev/null +++ b/ssh-factories/jsch/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + io.quarkiverse.jgit + quarkus-jgit-parent + 999-SNAPSHOT + + quarkus-jgit-jsch-parent + Quarkus - JGit - SSH Providers - JSch - Parent + pom + + runtime + deployment + integration-tests + + diff --git a/ssh-factories/jsch/runtime/pom.xml b/ssh-factories/jsch/runtime/pom.xml new file mode 100644 index 0000000..e149ff9 --- /dev/null +++ b/ssh-factories/jsch/runtime/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + io.quarkiverse.jgit + quarkus-jgit-jsch-parent + 999-SNAPSHOT + + quarkus-jgit-jsch + Quarkus - JGit - SSH Providers - JSch - Runtime + + + + io.quarkiverse.jsch + quarkus-jsch + + + org.eclipse.jgit + org.eclipse.jgit.ssh.jsch + + + + + + + io.quarkus + quarkus-extension-maven-plugin + ${quarkus.version} + + + compile + + extension-descriptor + + + ${project.groupId}:${project.artifactId}-deployment:${project.version} + + + + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${quarkus.version} + + + + + + + diff --git a/ssh-factories/jsch/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/ssh-factories/jsch/runtime/src/main/resources/META-INF/quarkus-extension.yaml new file mode 100644 index 0000000..42a3988 --- /dev/null +++ b/ssh-factories/jsch/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -0,0 +1,10 @@ +--- +artifact: ${project.groupId}:${project.artifactId}:${project.version} +name: "JGit - JSch" +metadata: + keywords: + - "git" + categories: + - "miscellaneous" + guide: https://docs.quarkiverse.io/quarkus-jgit/dev/index.html + status: "stable" diff --git a/ssh-factories/sshd/deployment/pom.xml b/ssh-factories/sshd/deployment/pom.xml new file mode 100644 index 0000000..b90645a --- /dev/null +++ b/ssh-factories/sshd/deployment/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + + io.quarkiverse.jgit + quarkus-jgit-sshd-parent + 999-SNAPSHOT + + quarkus-jgit-sshd-deployment + Quarkus - JGit - SSH Providers - SSHD - Deployment + + + + io.quarkus + quarkus-core-deployment + + + io.quarkiverse.sshd + quarkus-sshd-deployment + + + io.quarkiverse.jgit + quarkus-jgit-sshd + ${project.version} + + + io.quarkus + quarkus-junit5-internal + test + + + + + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${quarkus.version} + + + + + + + diff --git a/ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JgitSshdProcessor.java b/ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JgitSshdProcessor.java new file mode 100644 index 0000000..efc63e8 --- /dev/null +++ b/ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JgitSshdProcessor.java @@ -0,0 +1,14 @@ +package io.quarkiverse.quarkus.jgit.sshd.deployment; + +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.FeatureBuildItem; + +class JgitSshdProcessor { + + private static final String FEATURE = "jgit-sshd"; + + @BuildStep + FeatureBuildItem feature() { + return new FeatureBuildItem(FEATURE); + } +} diff --git a/ssh-factories/sshd/deployment/src/test/java/io/quarkiverse/quarkus/jgit/sshd/test/JgitSshdDevModeTest.java b/ssh-factories/sshd/deployment/src/test/java/io/quarkiverse/quarkus/jgit/sshd/test/JgitSshdDevModeTest.java new file mode 100644 index 0000000..baab58b --- /dev/null +++ b/ssh-factories/sshd/deployment/src/test/java/io/quarkiverse/quarkus/jgit/sshd/test/JgitSshdDevModeTest.java @@ -0,0 +1,23 @@ +package io.quarkiverse.quarkus.jgit.sshd.test; + +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.test.QuarkusDevModeTest; + +public class JgitSshdDevModeTest { + + // Start hot reload (DevMode) test with your extension loaded + @RegisterExtension + static final QuarkusDevModeTest devModeTest = new QuarkusDevModeTest() + .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)); + + @Test + public void writeYourOwnDevModeTest() { + // Write your dev mode tests here - see the testing extension guide https://quarkus.io/guides/writing-extensions#testing-hot-reload for more information + Assertions.assertTrue(true, "Add dev mode assertions to " + getClass().getName()); + } +} diff --git a/ssh-factories/sshd/deployment/src/test/java/io/quarkiverse/quarkus/jgit/sshd/test/JgitSshdTest.java b/ssh-factories/sshd/deployment/src/test/java/io/quarkiverse/quarkus/jgit/sshd/test/JgitSshdTest.java new file mode 100644 index 0000000..c193ce8 --- /dev/null +++ b/ssh-factories/sshd/deployment/src/test/java/io/quarkiverse/quarkus/jgit/sshd/test/JgitSshdTest.java @@ -0,0 +1,23 @@ +package io.quarkiverse.quarkus.jgit.sshd.test; + +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.test.QuarkusUnitTest; + +public class JgitSshdTest { + + // Start unit test with your extension loaded + @RegisterExtension + static final QuarkusUnitTest unitTest = new QuarkusUnitTest() + .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)); + + @Test + public void writeYourOwnUnitTest() { + // Write your unit tests here - see the testing extension guide https://quarkus.io/guides/writing-extensions#testing-extensions for more information + Assertions.assertTrue(true, "Add some assertions to " + getClass().getName()); + } +} diff --git a/ssh-factories/sshd/integration-tests/pom.xml b/ssh-factories/sshd/integration-tests/pom.xml new file mode 100644 index 0000000..43a011b --- /dev/null +++ b/ssh-factories/sshd/integration-tests/pom.xml @@ -0,0 +1,96 @@ + + + 4.0.0 + + + io.quarkiverse.jgit + quarkus-jgit-sshd-parent + 999-SNAPSHOT + + quarkus-jgit-sshd-integration-tests + Quarkus - JGit - SSH Providers - SSHD - Integration Tests + + true + + + + + io.quarkus + quarkus-resteasy-reactive + + + io.quarkiverse.jgit + quarkus-jgit-sshd + ${project.version} + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + + + + + io.quarkus + quarkus-maven-plugin + + + + build + + + + + + maven-failsafe-plugin + + + + integration-test + verify + + + + + + ${project.build.directory}/${project.build.finalName}-runner + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + + native-image + + + native + + + + + + maven-surefire-plugin + + ${native.surefire.skip} + + + + + + false + native + + + + diff --git a/ssh-factories/sshd/integration-tests/src/main/java/io/quarkiverse/quarkus/jgit/sshd/it/JgitSshdResource.java b/ssh-factories/sshd/integration-tests/src/main/java/io/quarkiverse/quarkus/jgit/sshd/it/JgitSshdResource.java new file mode 100644 index 0000000..cdf5db5 --- /dev/null +++ b/ssh-factories/sshd/integration-tests/src/main/java/io/quarkiverse/quarkus/jgit/sshd/it/JgitSshdResource.java @@ -0,0 +1,32 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package io.quarkiverse.quarkus.jgit.sshd.it; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; + +@Path("/jgit-sshd") +@ApplicationScoped +public class JgitSshdResource { + // add some rest methods here + + @GET + public String hello() { + return "Hello jgit-sshd"; + } +} diff --git a/ssh-factories/sshd/integration-tests/src/main/resources/application.properties b/ssh-factories/sshd/integration-tests/src/main/resources/application.properties new file mode 100644 index 0000000..e69de29 diff --git a/ssh-factories/sshd/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/sshd/it/JgitSshdResourceIT.java b/ssh-factories/sshd/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/sshd/it/JgitSshdResourceIT.java new file mode 100644 index 0000000..ba72ad4 --- /dev/null +++ b/ssh-factories/sshd/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/sshd/it/JgitSshdResourceIT.java @@ -0,0 +1,7 @@ +package io.quarkiverse.quarkus.jgit.sshd.it; + +import io.quarkus.test.junit.QuarkusIntegrationTest; + +@QuarkusIntegrationTest +public class JgitSshdResourceIT extends JgitSshdResourceTest { +} diff --git a/ssh-factories/sshd/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/sshd/it/JgitSshdResourceTest.java b/ssh-factories/sshd/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/sshd/it/JgitSshdResourceTest.java new file mode 100644 index 0000000..f22136b --- /dev/null +++ b/ssh-factories/sshd/integration-tests/src/test/java/io/quarkiverse/quarkus/jgit/sshd/it/JgitSshdResourceTest.java @@ -0,0 +1,21 @@ +package io.quarkiverse.quarkus.jgit.sshd.it; + +import static io.restassured.RestAssured.given; +import static org.hamcrest.Matchers.is; + +import org.junit.jupiter.api.Test; + +import io.quarkus.test.junit.QuarkusTest; + +@QuarkusTest +public class JgitSshdResourceTest { + + @Test + public void testHelloEndpoint() { + given() + .when().get("/jgit-sshd") + .then() + .statusCode(200) + .body(is("Hello jgit-sshd")); + } +} diff --git a/ssh-factories/sshd/pom.xml b/ssh-factories/sshd/pom.xml new file mode 100644 index 0000000..719abcf --- /dev/null +++ b/ssh-factories/sshd/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + io.quarkiverse.jgit + quarkus-jgit-parent + 999-SNAPSHOT + + quarkus-jgit-sshd-parent + Quarkus - JGit - SSH Providers - SSHD - Parent + pom + + runtime + deployment + integration-tests + + diff --git a/ssh-factories/sshd/runtime/pom.xml b/ssh-factories/sshd/runtime/pom.xml new file mode 100644 index 0000000..aa63cbf --- /dev/null +++ b/ssh-factories/sshd/runtime/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + + + io.quarkiverse.jgit + quarkus-jgit-sshd-parent + 999-SNAPSHOT + + quarkus-jgit-sshd + Quarkus - JGit - SSH Providers - SSHD - Runtime + + + + io.quarkus + quarkus-core + + + io.quarkiverse.sshd + quarkus-sshd + + + org.eclipse.jgit + org.eclipse.jgit.ssh.apache + + + + + + + io.quarkus + quarkus-extension-maven-plugin + ${quarkus.version} + + + compile + + extension-descriptor + + + ${project.groupId}:${project.artifactId}-deployment:${project.version} + + + + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${quarkus.version} + + + + + + + diff --git a/ssh-factories/sshd/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/ssh-factories/sshd/runtime/src/main/resources/META-INF/quarkus-extension.yaml new file mode 100644 index 0000000..ff71f85 --- /dev/null +++ b/ssh-factories/sshd/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -0,0 +1,10 @@ +--- +artifact: ${project.groupId}:${project.artifactId}:${project.version} +name: "JGit - SSHD" +metadata: + keywords: + - "git" + categories: + - "miscellaneous" + guide: https://docs.quarkiverse.io/quarkus-jgit/dev/index.html + status: "experimental" From 03b37410e2710fb1a816518c15d066cf04bb57f7 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Fri, 29 Mar 2024 10:36:55 -0300 Subject: [PATCH 2/8] Generate quarkus-jgit-bom --- pom.xml | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2f95e79..4dd2010 100644 --- a/pom.xml +++ b/pom.xml @@ -20,10 +20,11 @@ ssh-factories/jsch - 3.8.3 6.9.0.202403050737-r + 3.8.3 3.0.7 1.1.0 + 0.103.1 scm:git:git@github.com:quarkiverse/quarkus-jgit.git @@ -88,6 +89,41 @@ + + + io.sundr + sundr-maven-plugin + ${sundr-maven-plugin.version} + + + false + + generate-bom + + + + + quarkus-jgit-bom + Quarkus JGit: BOM + Centralized dependencyManagement for the Quarkus JGit Project + + true + true + + + + *:*-docs + *:*-integration-tests + + + + + + + + + + From c208cba223a344c106198b2839ffe240ccea8a06 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Mon, 1 Apr 2024 09:08:41 -0300 Subject: [PATCH 3/8] Fixed relativePath --- ssh-factories/jsch/pom.xml | 1 + ssh-factories/sshd/pom.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/ssh-factories/jsch/pom.xml b/ssh-factories/jsch/pom.xml index 679eeb0..9551aeb 100644 --- a/ssh-factories/jsch/pom.xml +++ b/ssh-factories/jsch/pom.xml @@ -5,6 +5,7 @@ io.quarkiverse.jgit quarkus-jgit-parent 999-SNAPSHOT + ../../pom.xml quarkus-jgit-jsch-parent Quarkus - JGit - SSH Providers - JSch - Parent diff --git a/ssh-factories/sshd/pom.xml b/ssh-factories/sshd/pom.xml index 719abcf..4d34135 100644 --- a/ssh-factories/sshd/pom.xml +++ b/ssh-factories/sshd/pom.xml @@ -5,6 +5,7 @@ io.quarkiverse.jgit quarkus-jgit-parent 999-SNAPSHOT + ../../pom.xml quarkus-jgit-sshd-parent Quarkus - JGit - SSH Providers - SSHD - Parent From 624c38abbfd8ab4ac68e78598f913639d4a68248 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Mon, 1 Apr 2024 09:15:49 -0300 Subject: [PATCH 4/8] Changed module build order --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4dd2010..7be4368 100644 --- a/pom.xml +++ b/pom.xml @@ -16,8 +16,8 @@ runtime docs integration-tests - ssh-factories/sshd ssh-factories/jsch + ssh-factories/sshd 6.9.0.202403050737-r From a1cf821131453ad1977d12fad3cd0d6a121c5800 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Mon, 1 Apr 2024 09:52:15 -0300 Subject: [PATCH 5/8] Excluding net.i2p.crypto:eddsa --- .../jgit/jsch/deployment/JgitJschProcessor.java | 6 ------ .../jgit/sshd/deployment/JgitSshdProcessor.java | 9 --------- ssh-factories/sshd/runtime/pom.xml | 12 ++++++++++++ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java b/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java index 81e72f1..ba962d6 100644 --- a/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java +++ b/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java @@ -5,10 +5,4 @@ class JgitJschProcessor { - private static final String FEATURE = "jgit-jsch"; - - @BuildStep - FeatureBuildItem feature() { - return new FeatureBuildItem(FEATURE); - } } diff --git a/ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JgitSshdProcessor.java b/ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JgitSshdProcessor.java index efc63e8..0fe01a3 100644 --- a/ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JgitSshdProcessor.java +++ b/ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JgitSshdProcessor.java @@ -1,14 +1,5 @@ package io.quarkiverse.quarkus.jgit.sshd.deployment; -import io.quarkus.deployment.annotations.BuildStep; -import io.quarkus.deployment.builditem.FeatureBuildItem; - class JgitSshdProcessor { - private static final String FEATURE = "jgit-sshd"; - - @BuildStep - FeatureBuildItem feature() { - return new FeatureBuildItem(FEATURE); - } } diff --git a/ssh-factories/sshd/runtime/pom.xml b/ssh-factories/sshd/runtime/pom.xml index aa63cbf..fc72b01 100644 --- a/ssh-factories/sshd/runtime/pom.xml +++ b/ssh-factories/sshd/runtime/pom.xml @@ -18,10 +18,22 @@ io.quarkiverse.sshd quarkus-sshd + + + net.i2p.crypto + eddsa + + org.eclipse.jgit org.eclipse.jgit.ssh.apache + + + net.i2p.crypto + eddsa + + From 5f591b724363961c69e4ddbb87ea62ac0ad815e9 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Mon, 1 Apr 2024 12:32:04 -0300 Subject: [PATCH 6/8] Sort imports --- .../quarkus/jgit/jsch/deployment/JgitJschProcessor.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java b/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java index ba962d6..f517b88 100644 --- a/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java +++ b/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java @@ -1,8 +1,5 @@ package io.quarkiverse.quarkus.jgit.jsch.deployment; -import io.quarkus.deployment.annotations.BuildStep; -import io.quarkus.deployment.builditem.FeatureBuildItem; - class JgitJschProcessor { } From 10b9485378cf1d4f77f6443b3702da2db590fc89 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Thu, 11 Apr 2024 10:10:07 -0300 Subject: [PATCH 7/8] Produce ServiceProviderBuildItems --- .../jgit/jsch/deployment/JGitJschProcessor.java | 15 +++++++++++++++ .../jgit/jsch/deployment/JgitJschProcessor.java | 5 ----- .../jgit/sshd/deployment/JGitSshdProcessor.java | 15 +++++++++++++++ .../jgit/sshd/deployment/JgitSshdProcessor.java | 5 ----- 4 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JGitJschProcessor.java delete mode 100644 ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java create mode 100644 ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JGitSshdProcessor.java delete mode 100644 ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JgitSshdProcessor.java diff --git a/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JGitJschProcessor.java b/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JGitJschProcessor.java new file mode 100644 index 0000000..65b922b --- /dev/null +++ b/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JGitJschProcessor.java @@ -0,0 +1,15 @@ +package io.quarkiverse.quarkus.jgit.jsch.deployment; + +import org.eclipse.jgit.transport.SshSessionFactory; +import org.eclipse.jgit.transport.ssh.jsch.JschConfigSessionFactory; + +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem; + +class JGitJschProcessor { + + @BuildStep + ServiceProviderBuildItem serviceProvider() { + return new ServiceProviderBuildItem(SshSessionFactory.class.getName(), JschConfigSessionFactory.class.getName()); + } +} diff --git a/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java b/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java deleted file mode 100644 index f517b88..0000000 --- a/ssh-factories/jsch/deployment/src/main/java/io/quarkiverse/quarkus/jgit/jsch/deployment/JgitJschProcessor.java +++ /dev/null @@ -1,5 +0,0 @@ -package io.quarkiverse.quarkus.jgit.jsch.deployment; - -class JgitJschProcessor { - -} diff --git a/ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JGitSshdProcessor.java b/ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JGitSshdProcessor.java new file mode 100644 index 0000000..31d397e --- /dev/null +++ b/ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JGitSshdProcessor.java @@ -0,0 +1,15 @@ +package io.quarkiverse.quarkus.jgit.sshd.deployment; + +import org.eclipse.jgit.transport.SshSessionFactory; +import org.eclipse.jgit.transport.sshd.SshdSessionFactory; + +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem; + +class JGitSshdProcessor { + + @BuildStep + ServiceProviderBuildItem serviceProvider() { + return new ServiceProviderBuildItem(SshSessionFactory.class.getName(), SshdSessionFactory.class.getName()); + } +} diff --git a/ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JgitSshdProcessor.java b/ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JgitSshdProcessor.java deleted file mode 100644 index 0fe01a3..0000000 --- a/ssh-factories/sshd/deployment/src/main/java/io/quarkiverse/quarkus/jgit/sshd/deployment/JgitSshdProcessor.java +++ /dev/null @@ -1,5 +0,0 @@ -package io.quarkiverse.quarkus.jgit.sshd.deployment; - -class JgitSshdProcessor { - -} From c0b9b1d5b7c643059857cc6ae1a2053c40646063 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Wed, 17 Apr 2024 20:33:28 -0300 Subject: [PATCH 8/8] Bump to Quarkus 3.8.4 --- docs/modules/ROOT/pages/includes/attributes.adoc | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/modules/ROOT/pages/includes/attributes.adoc b/docs/modules/ROOT/pages/includes/attributes.adoc index 70ffe84..ea4a458 100644 --- a/docs/modules/ROOT/pages/includes/attributes.adoc +++ b/docs/modules/ROOT/pages/includes/attributes.adoc @@ -1,4 +1,4 @@ -:quarkus-version: 3.8.3 +:quarkus-version: 3.8.4 :quarkus-jgit-version: 3.1.0 :project-version: 3.1.0 :examples-dir: ./../examples/ diff --git a/pom.xml b/pom.xml index 7be4368..a79393d 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 6.9.0.202403050737-r - 3.8.3 + 3.8.4 3.0.7 1.1.0 0.103.1