Skip to content

Commit 96da865

Browse files
fix multimodule deploy (forcedotcom#22)
1 parent 5996c91 commit 96da865

File tree

11 files changed

+711
-531
lines changed

11 files changed

+711
-531
lines changed

.github/workflows/build.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [ "main" ]
88

9+
env:
10+
MAVEN_ARGS: --batch-mode --no-transfer-progress -V -e -Dstyle.color=always
11+
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest
@@ -22,7 +25,8 @@ jobs:
2225
- name: Get hyperd version
2326
id: evaluate-property
2427
run: |
25-
echo "HYPER_VERSION=$(mvn help:evaluate -Dexpression=hyperapi.version -q -DforceStdout)" >> $GITHUB_ENV
28+
HYPER_VERSION=$(grep "<hyperapi.version>" pom.xml | sed -n 's/.*<hyperapi.version>\(.*\)<\/hyperapi.version>.*/\1/p')
29+
echo "HYPER_VERSION=$HYPER_VERSION" >> $GITHUB_ENV
2630
- name: Cache hyperd
2731
uses: actions/cache@v3
2832
with:
@@ -32,4 +36,4 @@ jobs:
3236
restore-keys: |
3337
${{ runner.os }}-hyper-${{ env.HYPER_VERSION }}
3438
- name: Maven package
35-
run: mvn --batch-mode --no-transfer-progress clean package --file pom.xml
39+
run: mvn $MAVEN_ARGS clean package --file pom.xml

.github/workflows/release.yml

+9-6
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ on:
44
release:
55
types: [ "created" ]
66

7+
env:
8+
MAVEN_ARGS: --batch-mode --no-transfer-progress -V -e -Dstyle.color=always
9+
710
jobs:
8-
build:
11+
release:
912
runs-on: ubuntu-latest
10-
1113
steps:
1214
- uses: actions/checkout@v4
1315
- name: Set up JDK 8
@@ -23,7 +25,8 @@ jobs:
2325
- name: Get hyperd version
2426
id: evaluate-property
2527
run: |
26-
echo "HYPER_VERSION=$(mvn help:evaluate -Dexpression=hyperapi.version -q -DforceStdout)" >> $GITHUB_ENV
28+
HYPER_VERSION=$(grep "<hyperapi.version>" pom.xml | sed -n 's/.*<hyperapi.version>\(.*\)<\/hyperapi.version>.*/\1/p')
29+
echo "HYPER_VERSION=$HYPER_VERSION" >> $GITHUB_ENV
2730
- name: Cache hyperd
2831
uses: actions/cache@v3
2932
with:
@@ -33,9 +36,9 @@ jobs:
3336
restore-keys: |
3437
${{ runner.os }}-hyper-${{ env.HYPER_VERSION }}
3538
- name: Set version
36-
run: mvn versions:set --no-transfer-progress -DnewVersion=${{ github.event.release.tag_name }}
37-
- name: Build with Maven
38-
run: mvn --batch-mode --no-transfer-progress clean deploy -P release --file pom.xml
39+
run: mvn $MAVEN_ARGS versions:set -DnewVersion=${{ github.event.release.tag_name }}
40+
- name: Deploy with Maven
41+
run: mvn $MAVEN_ARGS clean deploy -Prelease --file pom.xml
3942
env:
4043
MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
4144
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ jdbc-driver/src/main/resources/config/config.properties
2121

2222
*.iml
2323
pom.xml.bak
24-
.codegenie
24+
.codegenie
25+
26+
.vscode

jdbc-grpc/pom.xml

+39-11
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,18 @@
44
<parent>
55
<groupId>com.salesforce.datacloud</groupId>
66
<artifactId>jdbc-parent</artifactId>
7-
<version>0.24.0-SNAPSHOT</version>
7+
<version>0.25.0-SNAPSHOT</version>
8+
<relativePath>../jdbc-parent</relativePath>
89
</parent>
910

1011
<artifactId>jdbc-grpc</artifactId>
1112

1213
<properties>
13-
<maven.compiler.source>${java.version}</maven.compiler.source>
14-
<maven.compiler.target>${java.version}</maven.compiler.target>
15-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
<maven.deploy.skip>false</maven.deploy.skip>
15+
<rootDirectory>${project.basedir}/../</rootDirectory>
1616
</properties>
1717

1818
<dependencies>
19-
<dependency>
20-
<groupId>com.salesforce.datacloud</groupId>
21-
<artifactId>jdbc-proto</artifactId>
22-
<version>${project.version}</version>
23-
</dependency>
2419
<dependency>
2520
<groupId>io.grpc</groupId>
2621
<artifactId>grpc-netty</artifactId>
@@ -40,17 +35,37 @@
4035
</dependencies>
4136

4237
<build>
38+
<sourceDirectory>${project.build.directory}/generated-sources/protobuf</sourceDirectory>
4339
<plugins>
40+
<plugin>
41+
<groupId>org.codehaus.mojo</groupId>
42+
<artifactId>build-helper-maven-plugin</artifactId>
43+
<version>${build-helper-maven-plugin.version}</version>
44+
<executions>
45+
<execution>
46+
<goals>
47+
<goal>add-source</goal>
48+
</goals>
49+
<phase>generate-sources</phase>
50+
<configuration>
51+
<sources>
52+
<source>${project.build.directory}/generated-sources/protobuf/grpc-java</source>
53+
<source>${project.build.directory}/generated-sources/protobuf/java</source>
54+
</sources>
55+
</configuration>
56+
</execution>
57+
</executions>
58+
</plugin>
4459
<plugin>
4560
<groupId>org.xolstice.maven.plugins</groupId>
4661
<artifactId>protobuf-maven-plugin</artifactId>
47-
<version>0.6.1</version>
62+
<version>${protobuf-maven-plugin.version}</version>
4863
<configuration>
4964
<protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
5065
<pluginId>grpc-java</pluginId>
5166
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
5267
<attachProtoSources>false</attachProtoSources>
53-
<protoSourceRoot>${project.parent.basedir}/jdbc-proto/src/main/proto</protoSourceRoot>
68+
<protoSourceRoot>${project.basedir}/../jdbc-proto/src/main/proto</protoSourceRoot>
5469
</configuration>
5570
<executions>
5671
<execution>
@@ -61,6 +76,19 @@
6176
</execution>
6277
</executions>
6378
</plugin>
79+
<plugin>
80+
<groupId>org.apache.maven.plugins</groupId>
81+
<artifactId>maven-javadoc-plugin</artifactId>
82+
<configuration>
83+
<doclint>none</doclint>
84+
<additionalJOption>-Xdoclint:none</additionalJOption>
85+
<sourcepath>${project.build.directory}/generated-sources/protobuf/java;${project.build.directory}/generated-sources/protobuf/grpc-java;</sourcepath>
86+
<source>${java.version}</source>
87+
<quiet>true</quiet>
88+
<outputDirectory>${project.build.directory}/apidocs</outputDirectory>
89+
<failOnWarnings>false</failOnWarnings>
90+
</configuration>
91+
</plugin>
6492
</plugins>
6593
</build>
6694
</project>

0 commit comments

Comments
 (0)