Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Java releases #313

Merged
merged 1 commit into from Nov 12, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Expand Up @@ -53,7 +53,7 @@ build-node: build-protos
cd $(node_dir); npm install; npm run build; rm -f fabric-gateway-dev.tgz; mv $$(npm pack) fabric-gateway-dev.tgz

build-java: build-protos
cd $(java_dir); mvn install -DskipTests -Dmaven.javadoc.skip=true
cd $(java_dir); mvn install -DskipTests

unit-test: generate unit-test-go unit-test-node unit-test-java

Expand Down Expand Up @@ -99,7 +99,7 @@ run-samples-node: build-node
cd $(samples_dir)/node; rm -rf package-lock.json node_modules; npm install; npm run build; npm start

run-samples-java: build-java
cd $(samples_dir)/java; mvn clean compile exec:java -Dexec.mainClass='com.example.Sample' -Dmaven.javadoc.skip=true
cd $(samples_dir)/java; mvn clean compile exec:java -Dexec.mainClass='com.example.Sample'

generate:
go generate ./pkg/...
Expand All @@ -115,7 +115,7 @@ scenario-test-node: vendor-chaincode build-node
cd $(scenario_dir)/node; rm -rf package-lock.json node_modules; npm install; SOFTHSM2_CONF=${HOME}/softhsm2.conf npm test

scenario-test-java: vendor-chaincode build-java
cd $(java_dir); mvn verify -Dmaven.javadoc.skip=true
cd $(java_dir); mvn verify

scenario-test: scenario-test-go scenario-test-node scenario-test-java

Expand Down
4 changes: 0 additions & 4 deletions ci/azure-pipelines.yml
Expand Up @@ -142,8 +142,6 @@ stages:
- task: NodeTool@0
inputs:
versionSpec: $(NODEVER)
- script: node --version
displayName: node version DELETE ME
- script: make unit-test-node
displayName: Run Node unit tests
- publish: $(System.DefaultWorkingDirectory)/node
Expand All @@ -161,8 +159,6 @@ stages:
versionSpec: $(JAVAVER)
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- script: java -version
displayName: java version DELETE ME
- script: make unit-test-java
displayName: Run Java unit tests
# - script: bash <(curl https://codecov.io/bash) -t $CODECOV_UPLOAD_TOKEN
Expand Down
225 changes: 121 additions & 104 deletions java/pom.xml
Expand Up @@ -40,6 +40,7 @@
<protobufVersion>3.17.2</protobufVersion> <!-- keep in step with the version used by io.grpc:grpc-protobuf -->
<cucumberVersion>7.0.0</cucumberVersion>
<junitVersion>5.8.1</junitVersion>
<enforceJavaVersion>1.8</enforceJavaVersion> <!-- this is overridden in the release profile -->
</properties>

<repositories>
Expand Down Expand Up @@ -156,84 +157,114 @@
<version>1.6.2</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${javaVersion}</source>
<target>${javaVersion}</target>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<compilerArgs>
<arg>-Xlint</arg>
<!-- Disable command line warnings, seen when building against multiple releases: -->
<arg>-Xlint:-options</arg>
<arg>-Xlint:-processing</arg>
<arg>-Werror</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<excludes>
<exclude>**/scenario/**</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>scenarios</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/RunScenarioTest</include>
</includes>
</configuration>
</execution>
<execution>
<id>setup</id>
<phase>pre-integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/SetupScenarioTest</include>
</includes>
</configuration>
</execution>
<execution>
<id>cleanup</id>
<phase>post-integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/CleanupScenarioTest</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>enforce-version</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>${enforceJavaVersion}</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-help-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>show-profiles</id>
<phase>validate</phase>
<goals>
<goal>active-profiles</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${javaVersion}</source>
<target>${javaVersion}</target>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<compilerArgs>
<arg>-Xlint</arg>
<!-- Disable command line warnings, seen when building against multiple releases: -->
<arg>-Xlint:-options</arg>
<arg>-Xlint:-processing</arg>
<arg>-Werror</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<excludes>
<exclude>**/scenario/**</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>scenarios</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/RunScenarioTest</include>
</includes>
</configuration>
</execution>
<execution>
<id>setup</id>
<phase>pre-integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/SetupScenarioTest</include>
</includes>
</configuration>
</execution>
<execution>
<id>cleanup</id>
<phase>post-integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/CleanupScenarioTest</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand All @@ -252,7 +283,7 @@
<source>${javaVersion}</source>
<detectJavaApiLink>false</detectJavaApiLink>
<additionalJOptions>
<additionalJOption>--no-module-directories</additionalJOption>
<additionalJOption>${additionalJavadocOpts}</additionalJOption>
</additionalJOptions>
</configuration>
<executions>
Expand Down Expand Up @@ -331,6 +362,15 @@
</repository>
</distributionManagement>
<profiles>
<profile>
<id>javadoc-no-module-directories</id>
<activation>
<jdk>[11,)</jdk>
</activation>
<properties>
<additionalJavadocOpts>--no-module-directories</additionalJavadocOpts>
</properties>
</profile>
<profile>
<id>owasp</id>
<build>
Expand Down Expand Up @@ -358,6 +398,9 @@
</profile>
<profile>
<id>release</id>
<properties>
<enforceJavaVersion>[1.8,1.9)</enforceJavaVersion> <!-- must use 1.8 JDK for release build -->
</properties>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -412,32 +455,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<excludePackageNames>
org.hyperledger.fabric.protos.gateway.impl:org.hyperledger.fabric.protos.*
</excludePackageNames>
<show>public</show>
<doctitle>Hyperledger Fabric Gateway SDK for Java</doctitle>
<nohelp>true</nohelp>
<failOnError>true</failOnError>
<failOnWarnings>true</failOnWarnings>
<additionalJOptions>
<additionalJOption>--no-module-directories</additionalJOption>
</additionalJOptions>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down