commit 4995b57f1bbf73676dd86c77beb61540ee5da464 Author: Dave Syer Date: Wed Sep 4 13:28:16 2024 +0100 Starting point diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..7051a74 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,35 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +on: + push: + branches: [ main ] + +jobs: + build: + name: Build and Deploy On Push + + runs-on: ubuntu-latest + if: ${{ github.repository == 'spring-projects-experimental/spring-grpc' }} + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Deploy with Maven + env: + spring_username: ${{ secrets.ARTIFACTORY_USERNAME }} + spring_password: ${{ secrets.ARTIFACTORY_PASSWORD }} + sonatype_username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }} + sonatype_password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }} + signing_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.GPG_PASSPHRASE }} + run: | + echo "${signing_key}" > private.asc + gpg --import --batch --no-tty private.asc + ./mvnw -B deploy -s .mvn/settings.xml + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b6e4749 --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +target +.classpath +.project +.settings +bin/ +build.log +integration-repo +ivy-cache +spring-build +.idea +*.iml +*.ipr +*.iws +.*.swp +.DS_Store +.springBeans +build +.gradle +out + +/.gradletasknamecache +**/*.flattened-pom.xml + +vscode +settings.json + +node +node_modules +package-lock.json +package.json +.vscode +.antlr + +shell.log + +.profiler +nbproject/ + diff --git a/.mvn/settings.xml b/.mvn/settings.xml new file mode 100644 index 0000000..ff45800 --- /dev/null +++ b/.mvn/settings.xml @@ -0,0 +1,46 @@ + + + + + release + + true + + + ${env.passphrase} + + + + + + sonatype-nexus-staging + ${env.sonatype_username} + ${env.sonatype_password} + + + repo.spring.io + ${env.spring_username} + ${env.spring_password} + + + spring-libs-milestones + ${env.spring_username} + ${env.spring_password} + + + spring-libs-snapshots + ${env.spring_username} + ${env.spring_password} + + + spring-libs-releases + ${env.spring_username} + ${env.spring_password} + + + spring-libs-plugins + ${env.spring_username} + ${env.spring_password} + + + \ No newline at end of file diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000..9cc84ea Binary files /dev/null and b/.mvn/wrapper/maven-wrapper.jar differ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..6c8c0e0 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1 @@ +distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip diff --git a/README.md b/README.md new file mode 100644 index 0000000..ad0bdef --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# Spring Grpc [![build status](https://github.com/spring-projects-experimental/spring-grpc/actions/workflows/deploy.yml/badge.svg)](https://github.com/spring-projects/spring-ai/actions/workflows/deploy.yml) + +Welcome to the Spring Grpc project! + +The Spring Grpc project provides a Spring-friendly API and abstractions for developing Grpc applications. + +For further information go to our [Spring Grpc reference documentation](https://docs.spring.io/spring-gprc/reference/). + diff --git a/mvnw b/mvnw new file mode 100755 index 0000000..ab73fc9 --- /dev/null +++ b/mvnw @@ -0,0 +1,253 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# 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 +# +# https://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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven2 Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # + # Look for the Apple JDKs first to preserve the existing behaviour, and then look + # for the new JDKs provided by Oracle. + # + if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ] ; then + # + # Apple JDKs + # + export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home + fi + + if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ] ; then + # + # Apple JDKs + # + export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home + fi + + if [ -z "$JAVA_HOME" ] && [ -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ] ; then + # + # Oracle JDKs + # + export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home + fi + + if [ -z "$JAVA_HOME" ] && [ -x "/usr/libexec/java_home" ]; then + # + # Apple JDKs + # + export JAVA_HOME=`/usr/libexec/java_home` + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Migwn, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" + # TODO classpath? +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` +fi + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + local basedir=$(pwd) + local wdir=$(pwd) + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + wdir=$(cd "$wdir/.."; pwd) + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)} +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +echo "Running version check" +VERSION=$( sed '\!//' -e 's!.*$!!' ) +echo "The found version is [${VERSION}]" + +if echo $VERSION | egrep -q 'M|RC'; then + echo Activating \"milestone\" profile for version=\"$VERSION\" + echo $MAVEN_ARGS | grep -q milestone || MAVEN_ARGS="$MAVEN_ARGS -Pmilestone" +else + echo Deactivating \"milestone\" profile for version=\"$VERSION\" + echo $MAVEN_ARGS | grep -q milestone && MAVEN_ARGS=$(echo $MAVEN_ARGS | sed -e 's/-Pmilestone//') +fi + +if echo $VERSION | egrep -q '[0-9]*\.[0-9]*\.[0-9]*$|RELEASE'; then + echo Activating \"central\" profile for version=\"$VERSION\" + echo $MAVEN_ARGS | grep -q milestone || MAVEN_ARGS="$MAVEN_ARGS -Pcentral" +else + echo Deactivating \"central\" profile for version=\"$VERSION\" + echo $MAVEN_ARGS | grep -q central && MAVEN_ARGS=$(echo $MAVEN_ARGS | sed -e 's/-Pcentral//') +fi + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} ${MAVEN_ARGS} "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..eb9a292 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,145 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +set MAVEN_CMD_LINE_ARGS=%* + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" + +set WRAPPER_JAR="".\.mvn\wrapper\maven-wrapper.jar"" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CMD_LINE_ARGS% +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..921c79d --- /dev/null +++ b/pom.xml @@ -0,0 +1,499 @@ + + 4.0.0 + + org.springframework.grpc + spring-grpc + 0.1.0-SNAPSHOT + + pom + https://github.com/spring-projects-experimental/spring-grpc + + Spring Grpc + Building Grpc applications with Spring Boot + + + spring-grpc-docs + spring-grpc-bom + spring-grpc-core + spring-grpc-test + spring-grpc-spring-boot-autoconfigure + + + + Broadcom Inc. + https://spring.io + + + https://github.com/spring-projects-experimental/spring-grpc + git://github.com/spring-projects-experimental/spring-grpc.git + git@github.com:spring-projects-experimental/spring-grpc.git + + + Github Issues + https://github.com/spring-projects-experimental/spring-grpc/issues + + + Github Actions + https://github.com/spring-projects-experimental/spring-grpc/actions + + + https://github.com/spring-projects-experimental/spring-grpc + + spring-docs + scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-grpc/docs/${project.artifactId}/${project.version} + + + sonatype-nexus-staging + Nexus Release Repository + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + repo.spring.io + https://repo.spring.io/libs-snapshot-local + + false + + + + + + Apache 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + UTF-8 + UTF-8 + 17 + 17 + 17 + + + 4.1.3 + 3.3.3 + 6.1.4 + + + 3.25.2 + 1.63.0 + + + 5.3.1 + + + 1.20.1 + 2.0.1 + + + 0.0.4 + 1.6.2 + 1.5.1 + 0.0.6 + + + 3.11.0 + 3.1.2 + 3.1.2 + 3.5.0 + 3.3.0 + 0.8.10 + 1.5.0 + 3.1.1 + 2.2.3 + 3.7.0 + 3.5.0 + + 4.0.0-M13 + 3.4.5 + 3.3.0 + 0.0.39 + + + + + + + io.spring.javaformat + spring-javaformat-maven-plugin + ${spring-javaformat-maven-plugin.version} + + + validate + true + + validate + + + + + + org.apache.maven.plugins + maven-site-plugin + ${maven-site-plugin.version} + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.version} + + -parameters + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + ${surefireArgLine} + + + + org.apache.maven.plugins + maven-jar-plugin + ${maven-jar-plugin.version} + + + + ${project.artifactId} + ${project.version} + + + + + + org.apache.maven.plugins + maven-source-plugin + ${maven-source-plugin.version} + + + generate-sources + package + + jar + + + + + + org.codehaus.mojo + flatten-maven-plugin + ${flatten-maven-plugin.version} + + + flatten + process-resources + + flatten + + + true + ossrh + + remove + remove + remove + keep + keep + resolve + + + + + clean + clean + + clean + + + + + + org.apache.maven.plugins + maven-deploy-plugin + ${maven-deploy-plugin.version} + + + + + + + license + + false + + + + + com.mycila + license-maven-plugin + 4.1 + + + validate + + check + + + + + + the original author or authors. + + 2024 + + + + + Copyright 2023 - ${year} the original author or + authors. Licensed 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 + https://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. + + + **/.antlr/** + **/aot.factories + **/.sdkmanrc + **/*.adoc + **/*.puml + **/pom.xml + **/*.properties + **/*.yaml + **/*.yml + **/*.map + **/*.html + **/*.xhtml + **/*.jsp + **/*.js + **/*.css + **/*.txt + **/*.xjb + **/*.ftl + **/*.xsd + **/*.xml + **/*.sh + **/generated/** + **/Dockerfile + + + + + + + + + + + javadoc + + false + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + org.springframework.grpc.sample.* + + ${project.basedir}/spring-grpc-docs/src/main/javadoc/overview.html + false + none + + true + + + + generate-javadocs + package + + jar + + + + generate-aggregate-javadocs + package + + aggregate + + + + + + + + + integration-tests + + false + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${maven-failsafe-plugin.version} + + + + integration-test + verify + + + + + + + + + test-coverage + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + prepare-agent + + prepare-agent + + + + report + + report + + + + + + + + + staging + + + repo.spring.io + https://repo.spring.io/libs-staging-local + + false + + + + + + milestone + + + repo.spring.io + https://repo.spring.io/libs-milestone-local + + false + + + + + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + com.google.protobuf + protobuf-bom + ${protobuf-java.version} + pom + import + + + io.grpc + grpc-bom + ${grpc.version} + pom + import + + + + + + + maven-central + https://repo.maven.apache.org/maven2/ + + false + + + true + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + false + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + + + + dsyer + Dave Syer + david.syer at broadcom.com + Broadcom + http://www.spring.io + + lead + + + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + ${maven-project-info-reports-plugin.version} + + true + + + + + + \ No newline at end of file diff --git a/spring-grpc-bom/pom.xml b/spring-grpc-bom/pom.xml new file mode 100644 index 0000000..8f984f2 --- /dev/null +++ b/spring-grpc-bom/pom.xml @@ -0,0 +1,90 @@ + + + 4.0.0 + + + org.springframework.grpc + spring-grpc + 0.1.0-SNAPSHOT + + + spring-grpc-bom + pom + + Spring Grpc BOM + Bill of Materials POM (BOM) for the Spring Grpc modules + + https://github.com/spring-projects-experimental/spring-grpc + + + https://github.com/spring-projects-experimental/spring-grpc + git://github.com/spring-projects-experimental/spring-grpc.git + git@github.com:spring-projects-experimental/spring-grpc.git + + + + + + + org.springframework.grpc + spring-grpc-core + ${project.version} + + + + + org.springframework.grpc + spring-grpc-test + ${project.version} + + + + org.springframework.grpc + spring-grpc-spring-boot-autoconfigure + ${project.version} + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + ${flatten-maven-plugin.version} + + + flatten + process-resources + + flatten + + + true + ossrh + + remove + keep + remove + keep + keep + resolve + + + + + clean + clean + + clean + + + + + + + + \ No newline at end of file diff --git a/spring-grpc-core/pom.xml b/spring-grpc-core/pom.xml new file mode 100644 index 0000000..bf920fd --- /dev/null +++ b/spring-grpc-core/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + + org.springframework.grpc + spring-grpc + 0.1.0-SNAPSHOT + + spring-grpc-core + jar + Spring Grpc Core + Core domgrpcn for Grpc programming + https://github.com/spring-projects-experimental/spring-grpc + + + https://github.com/spring-projects-experimental/spring-grpc + git://github.com/spring-projects-experimental/spring-grpc.git + git@github.com:spring-projects-experimental/spring-grpc.git + + + + + + org.springframework + spring-context + + + io.grpc + grpc-core + + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + \ No newline at end of file diff --git a/spring-grpc-core/src/main/java/org/springframework/grpc/package-info.java b/spring-grpc-core/src/main/java/org/springframework/grpc/package-info.java new file mode 100644 index 0000000..1b3bd40 --- /dev/null +++ b/spring-grpc-core/src/main/java/org/springframework/grpc/package-info.java @@ -0,0 +1,16 @@ +/* + * Copyright 2024-2024 the original author or authors. + * + * Licensed 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 + * + * https://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 org.springframework.grpc; \ No newline at end of file diff --git a/spring-grpc-docs/pom.xml b/spring-grpc-docs/pom.xml new file mode 100644 index 0000000..ce418d3 --- /dev/null +++ b/spring-grpc-docs/pom.xml @@ -0,0 +1,69 @@ + + + 4.0.0 + + org.springframework.grpc + spring-grpc + 0.1.0-SNAPSHOT + + spring-grpc-docs + Spring Grpc Docs + Spring Grpc documentation + + + + + io.spring.maven.antora + antora-maven-plugin + ${io.spring.maven.antora-version} + true + + src/main/antora/antora-playbook.yml + + @antora/atlas-extension@1.0.0-alpha.1 + @antora/collector-extension@1.0.0-alpha.3 + @asciidoctor/tabs@1.0.0-beta.3 + @springio/antora-extensions@1.5.0 + @springio/asciidoctor-extensions@1.0.0-alpha.9 + @djencks/asciidoctor-mathjax@0.0.9 + + + + + io.spring.maven.antora + antora-component-version-maven-plugin + ${io.spring.maven.antora-version} + + + + antora-component-version + + + + + + org.apache.maven.plugins + maven-assembly-plugin + ${maven-assembly-plugin.version} + + + src/assembly/javadocs.xml + + spring-grpc-${project.version} + true + + + + org.apache.maven.plugins + maven-deploy-plugin + ${maven-deploy-plugin.version} + + true + + + + + + \ No newline at end of file diff --git a/spring-grpc-docs/src/assembly/javadocs.xml b/spring-grpc-docs/src/assembly/javadocs.xml new file mode 100644 index 0000000..bde989c --- /dev/null +++ b/spring-grpc-docs/src/assembly/javadocs.xml @@ -0,0 +1,15 @@ + + docs + + zip + + false + + + ../target/site/apidocs + api + + + diff --git a/spring-grpc-docs/src/main/antora/antora-playbook.yml b/spring-grpc-docs/src/main/antora/antora-playbook.yml new file mode 100644 index 0000000..7a0247d --- /dev/null +++ b/spring-grpc-docs/src/main/antora/antora-playbook.yml @@ -0,0 +1,39 @@ +# PACKAGES antora@3.2.0-alpha.2 @antora/atlas-extension:1.0.0-alpha.1 @antora/collector-extension@1.0.0-alpha.3 @springio/antora-extensions@1.1.0-alpha.2 @asciidoctor/tabs@1.0.0-alpha.12 @opendevise/antora-release-line-extension@1.0.0-alpha.2 +# +# The purpose of this Antora playbook is to build the docs in the current branch. +antora: + extensions: + - '@antora/collector-extension' + - require: '@springio/antora-extensions/root-component-extension' + root_component_name: 'grpc' +site: + title: Spring Grpc Reference + url: https://docs.spring.io/spring-grpc/reference +content: + sources: + - url: ./../../../.. + branches: HEAD + start_path: spring-grpc-docs/src/main/antora + worktrees: true +asciidoc: + attributes: + page-pagination: '' + hide-uri-scheme: '@' + tabs-sync-option: '@' + chomp: 'all' + stem: 'asciimath' + extensions: + - '@asciidoctor/tabs' + - '@springio/asciidoctor-extensions' + - '@djencks/asciidoctor-mathjax' + sourcemap: true +urls: + latest_version_segment: '' +runtime: + log: + failure_level: warn + format: pretty +ui: + bundle: + url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.6/ui-bundle.zip + snapshot: true \ No newline at end of file diff --git a/spring-grpc-docs/src/main/antora/antora.yml b/spring-grpc-docs/src/main/antora/antora.yml new file mode 100644 index 0000000..fbfb663 --- /dev/null +++ b/spring-grpc-docs/src/main/antora/antora.yml @@ -0,0 +1,12 @@ +name: grpc +version: true +title: Spring Grpc +nav: + - modules/ROOT/nav.adoc +ext: + collector: + - run: + command: mvnw process-resources + local: true + scan: + dir: spring-grpc-docs/target/classes/antora-resources diff --git a/spring-grpc-docs/src/main/antora/modules/ROOT/nav.adoc b/spring-grpc-docs/src/main/antora/modules/ROOT/nav.adoc new file mode 100644 index 0000000..d6897c8 --- /dev/null +++ b/spring-grpc-docs/src/main/antora/modules/ROOT/nav.adoc @@ -0,0 +1,6 @@ +* xref:index.adoc[Overview] +* xref:concepts.adoc[Grpc Concepts] +* xref:getting-started.adoc[Getting Started] + +* xref:contribution-guidelines.adoc[Contribution Guidelines] + diff --git a/spring-grpc-docs/src/main/antora/modules/ROOT/pages/concepts.adoc b/spring-grpc-docs/src/main/antora/modules/ROOT/pages/concepts.adoc new file mode 100644 index 0000000..ecf8d0c --- /dev/null +++ b/spring-grpc-docs/src/main/antora/modules/ROOT/pages/concepts.adoc @@ -0,0 +1,4 @@ +[[concepts]] += Grpc Concepts + +This section describes core concepts that Spring Grpc uses. We recommend reading it closely to understand the ideas behind how Spring Grpc is implemented. diff --git a/spring-grpc-docs/src/main/antora/modules/ROOT/pages/contribution-guidelines.adoc b/spring-grpc-docs/src/main/antora/modules/ROOT/pages/contribution-guidelines.adoc new file mode 100644 index 0000000..e5cd06c --- /dev/null +++ b/spring-grpc-docs/src/main/antora/modules/ROOT/pages/contribution-guidelines.adoc @@ -0,0 +1,36 @@ +[[contribution-guidelines]] += Contribution Guidelines + +== Code Formatting and Javadoc + +Before submitting a PR, please run the following commands to ensure proper formatting and Javadoc processing + +``` +./mvnw spring-javaformat:apply javadoc:javadoc -Pjavadoc +``` + +The `-Pjavadoc` is a profile that enables Javadoc processing so as to avoid a long build time when developing. + +== Contributing a New Grpc Model Implementation + +This section outlines the steps for contributing a new Grpc model implementation. +Grpc models vary significantly, with diverse inputs and outputs -- from chat models that +translate text input into text output, to text-to-image models that generate images +from text descriptions. +Complex models may even handle multiple types of input and output, such as combining text, +images, and videos to produce mixed media output. + +To contribute a new feature, adhere to the following steps: + +. *Implement Auto-Configuration and a Spring Boot Starter*: This step involves creating the +necessary auto-configuration and Spring Boot Starter to easily instantiate the new model with +Spring Boot applications. + +. *Write Tests*: All new classes should be accompanied by comprehensive tests. +Existing tests can serve as a useful reference for structuring and implementing your tests. + +. *Document Your Contribution*: Ensure your documentation follows the existing format, +using the `spring-javaformat` plugin to format your code and Javadoc comments. + +By following these guidelines, we can greatly expand the framework's range of supported models +while following a common implementation and documentation pattern. diff --git a/spring-grpc-docs/src/main/antora/modules/ROOT/pages/getting-started.adoc b/spring-grpc-docs/src/main/antora/modules/ROOT/pages/getting-started.adoc new file mode 100644 index 0000000..7a2d09f --- /dev/null +++ b/spring-grpc-docs/src/main/antora/modules/ROOT/pages/getting-started.adoc @@ -0,0 +1,89 @@ +[[getting-started]] += Getting Started + +This section offers jumping off points for how to get started using Spring Grpc. + +You should follow the steps in each of the following section according to your needs. + +NOTE: Spring Grpc supports Spring Boot 3.3.x + +[[repositories]] +== Add Milestone and Snapshot Repositories + +If you prefer to add the dependency snippets by hand, follow the directions in the following sections. + +To use the Milestone and Snapshot version, you need to add references to the Spring Milestone and/or Snapshot repositories in your build file. + +For Maven, add the following repository definitions as needed: + +[source,xml] +---- + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + false + + + +---- + +For Gradle, add the following repository definitions as needed: + +[source,groovy] +---- +repositories { + mavenCentral() + maven { url 'https://repo.spring.io/milestone' } + maven { url 'https://repo.spring.io/snapshot' } +} +---- + + +[[dependency-management]] +== Dependency Management + +The Spring Grpc Bill of Materials (BOM) declares the recommended versions of all the dependencies used by a given release of Spring Grpc. +Using the BOM from your application’s build script avoids the need for you to specify and maintain the dependency versions yourself. +Instead, the version of the BOM you’re using determines the utilized dependency versions. +It also ensures that you’re using supported and tested versions of the dependencies by default, unless you choose to override them. + +If you’re a Maven user, you can use the BOM by adding the following to your pom.xml file - + +[source,xml] +---- + + + + org.springframework.ai + spring-grpc-bom + 1.0.0-SNAPSHOT + pom + import + + + +---- + +Gradle users can also use the Spring Grpc BOM by leveraging Gradle (5.0+) native support for declaring dependency constraints using a Maven BOM. +This is implemented by adding a 'platform' dependency handler method to the dependencies section of your Gradle build script. +As shown in the snippet below this can then be followed by version-less declarations of the Starter Dependencies for the one or more spring-grpc modules you wish to use, e.g. spring-grpc-openai. + +[source,gradle] +---- +dependencies { + implementation platform("org.springframework.ai:spring-grpc-bom:1.0.0-SNAPSHOT") + // Replace the following with the starter dependencies of specific modules you wish to use + implementation 'org.springframework.ai:spring-grpc-openai' +} +---- diff --git a/spring-grpc-docs/src/main/antora/modules/ROOT/pages/index.adoc b/spring-grpc-docs/src/main/antora/modules/ROOT/pages/index.adoc new file mode 100644 index 0000000..80b472d --- /dev/null +++ b/spring-grpc-docs/src/main/antora/modules/ROOT/pages/index.adoc @@ -0,0 +1,9 @@ +[[introduction]] += Spring Grpc + +The `Spring Grpc` project aims to streamline the development of Grpc applications. + +The xref:concepts.adoc[concepts section] provides a high-level overview of Grpc concepts and their representation in Spring Grpc. + +The xref:getting-started.adoc[Getting Started] section shows you how to create your first Grpc application. +Subsequent sections delve into each component and common use cases with a code-focused approach. diff --git a/spring-grpc-docs/src/main/antora/resources/antora-resources/antora.yml b/spring-grpc-docs/src/main/antora/resources/antora-resources/antora.yml new file mode 100644 index 0000000..b2b3baf --- /dev/null +++ b/spring-grpc-docs/src/main/antora/resources/antora-resources/antora.yml @@ -0,0 +1,2 @@ +version: ${antora-component.version} +prerelease: ${antora-component.prerelease} diff --git a/spring-grpc-docs/src/main/javadoc/overview.html b/spring-grpc-docs/src/main/javadoc/overview.html new file mode 100644 index 0000000..f6ac950 --- /dev/null +++ b/spring-grpc-docs/src/main/javadoc/overview.html @@ -0,0 +1,17 @@ + + +

+ This document is the API specification for Spring Grpc +

+
+

+ For further API reference and developer documentation, see the + + Spring Grpc reference documentation. + That documentation contains more detailed, developer-targeted + descriptions, with conceptual overviews, definitions of terms, + and working code examples. +

+
+ + diff --git a/spring-grpc-spring-boot-autoconfigure/pom.xml b/spring-grpc-spring-boot-autoconfigure/pom.xml new file mode 100644 index 0000000..2a14d6e --- /dev/null +++ b/spring-grpc-spring-boot-autoconfigure/pom.xml @@ -0,0 +1,86 @@ + + + 4.0.0 + + org.springframework.grpc + spring-grpc + 0.1.0-SNAPSHOT + + spring-grpc-spring-boot-autoconfigure + jar + Spring Grpc Auto Configuration + Spring Grpc Auto Configuration + https://github.com/spring-projects-experimental/spring-grpc + + + https://github.com/spring-projects-experimental/spring-grpc + git://github.com/spring-projects-experimental/spring-grpc.git + git@github.com:spring-projects-experimental/spring-grpc.git + + + + + + com.google.protobuf + protobuf-java + ${protobuf-java.version} + true + + + + + + org.springframework.grpc + spring-grpc-core + ${project.parent.version} + + + + org.springframework.boot + spring-boot-starter + + + + + + org.springframework.grpc + spring-grpc-test + ${project.parent.version} + test + + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.springframework.boot + spring-boot-testcontainers + test + + + + org.testcontainers + testcontainers + test + + + + org.awaitility + awaitility + test + + + + io.micrometer + micrometer-observation-test + test + + + + + diff --git a/spring-grpc-test/pom.xml b/spring-grpc-test/pom.xml new file mode 100644 index 0000000..d8f8ea0 --- /dev/null +++ b/spring-grpc-test/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + org.springframework.grpc + spring-grpc + 0.1.0-SNAPSHOT + + spring-grpc-test + jar + Spring Grpc Test + Test support for Grpc programming + https://github.com/spring-projects-experimental/spring-grpc + + + https://github.com/spring-projects-experimental/spring-grpc + git://github.com/spring-projects-experimental/spring-grpc.git + git@github.com:spring-projects-experimental/spring-grpc.git + + + + 17 + 17 + + + + + + org.springframework + spring-webmvc + + + + org.springframework.grpc + spring-grpc-core + ${project.version} + + + + org.springframework.boot + spring-boot-starter-test + + + com.vaadin.external.google + android-json + + + + + \ No newline at end of file