Skip to content

Commit 20db2e0

Browse files
committed
Do unified deployment in POM
1 parent e480c1b commit 20db2e0

File tree

5 files changed

+118
-156
lines changed

5 files changed

+118
-156
lines changed

deploy.sh

-140
This file was deleted.

release.sh

+13-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# ==============================================================================
1616
#
1717
# Script to upload release artifacts for the TensorFlow Java library to
18-
# Maven Central. See RELEASE.md for an explanation.
18+
# Maven Central. See RELEASE.md for explanation.
1919

2020
cd $(dirname "$0")
2121
STAGING_SEQ="$1"
@@ -34,12 +34,17 @@ fi
3434
# To get a shell to poke around the maven artifacts with.
3535
if [[ -z "${CMD}" ]]
3636
then
37-
CMD="bash deploy.sh"
37+
CMD="mvn clean deploy -B -e --settings ./settings.xml -Pdeploying -Preleasing"
3838
fi
3939

4040
export GPG_TTY=$(tty)
4141
set -ex
4242

43+
if [[ ! -f settings.xml ]]
44+
then
45+
cp -f ~/.m2/settings.xml .
46+
fi
47+
4348
docker run \
4449
-e IN_CONTAINER="true" \
4550
-e STAGING_SEQ="${STAGING_SEQ}" \
@@ -51,3 +56,9 @@ docker run \
5156
--platform linux/amd64 \
5257
maven:3.8.6-jdk-11 \
5358
${CMD}
59+
60+
echo
61+
echo "Uploaded to the staging repository"
62+
echo "After validating the release: "
63+
echo "* Login to https://oss.sonatype.org/#stagingRepositories"
64+
echo "* Find the 'org.tensorflow' staging release and click either 'Release' to release or 'Drop' to abort"

tensorflow-core/tensorflow-core-api/pom.xml

+2-10
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
<version>3.3.0</version>
213213
<executions>
214214
<execution>
215-
<id>attach-source</id>
215+
<id>attach-sources</id>
216216
<goals>
217217
<goal>jar-no-fork</goal>
218218
</goals>
@@ -237,15 +237,7 @@
237237
</execution>
238238
</executions>
239239
</plugin>
240-
<plugin>
241-
<artifactId>maven-assembly-plugin</artifactId>
242-
<version>3.6.0</version>
243-
<configuration>
244-
<descriptorRefs>
245-
<descriptorRef>jar-with-dependencies</descriptorRef>
246-
</descriptorRefs>
247-
</configuration>
248-
</plugin>
240+
249241
<plugin>
250242
<groupId>org.codehaus.mojo</groupId>
251243
<artifactId>exec-maven-plugin</artifactId>

tensorflow-core/tensorflow-core-native/pom.xml

+96-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<dist.download.skip>false</dist.download.skip>
2525
<dist.download.url/>
2626
<dist.download.folder>${project.build.directory}/dist/</dist.download.folder>
27-
<nativeSourceDirectory>${project.basedir}/src/main/native</nativeSourceDirectory>
27+
<native.source.directory>${project.basedir}/src/main/native</native.source.directory>
2828
</properties>
2929

3030
<dependencies>
@@ -81,6 +81,99 @@
8181
<javacpp.build.skip>true</javacpp.build.skip>
8282
<dist.download.skip>true</dist.download.skip>
8383
</properties>
84+
<build>
85+
<plugins>
86+
<plugin>
87+
<artifactId>maven-dependency-plugin</artifactId>
88+
<version>3.6.1</version>
89+
<executions>
90+
<execution>
91+
<id>copy-native-artifacts</id>
92+
<phase>validate</phase>
93+
<goals>
94+
<goal>copy</goal>
95+
</goals>
96+
<configuration>
97+
<outputDirectory>${project.build.directory}</outputDirectory>
98+
<overWriteSnapshots>true</overWriteSnapshots>
99+
<overWriteReleases>true</overWriteReleases>
100+
<useBaseVersion>true</useBaseVersion>
101+
<artifactItems>
102+
<artifactItem>
103+
<groupId>${project.groupId}</groupId>
104+
<artifactId>${project.artifactId}</artifactId>
105+
<version>${project.version}</version>
106+
<classifier>${javacpp.platform.linux-x86_64}</classifier>
107+
</artifactItem>
108+
<artifactItem>
109+
<groupId>${project.groupId}</groupId>
110+
<artifactId>${project.artifactId}</artifactId>
111+
<version>${project.version}</version>
112+
<classifier>${javacpp.platform.linux-x86_64}-gpu</classifier>
113+
</artifactItem>
114+
<artifactItem>
115+
<groupId>${project.groupId}</groupId>
116+
<artifactId>${project.artifactId}</artifactId>
117+
<version>${project.version}</version>
118+
<classifier>${javacpp.platform.macosx-x86_64}</classifier>
119+
</artifactItem>
120+
<artifactItem>
121+
<groupId>${project.groupId}</groupId>
122+
<artifactId>${project.artifactId}</artifactId>
123+
<version>${project.version}</version>
124+
<classifier>${javacpp.platform.macosx-arm64}</classifier>
125+
</artifactItem>
126+
<artifactItem>
127+
<groupId>${project.groupId}</groupId>
128+
<artifactId>${project.artifactId}</artifactId>
129+
<version>${project.version}</version>
130+
<classifier>${javacpp.platform.windows-x86_64}</classifier>
131+
</artifactItem>
132+
</artifactItems>
133+
</configuration>
134+
</execution>
135+
</executions>
136+
</plugin>
137+
<plugin>
138+
<groupId>org.codehaus.mojo</groupId>
139+
<artifactId>build-helper-maven-plugin</artifactId>
140+
<version>3.5.0</version>
141+
<executions>
142+
<execution>
143+
<id>attach-artifacts</id>
144+
<phase>validate</phase>
145+
<goals>
146+
<goal>attach-artifact</goal>
147+
</goals>
148+
<configuration>
149+
<artifacts>
150+
<artifact>
151+
<file>${project.build.directory}/${artifactId}-${project.version}-${javacpp.platform.linux-x86_64}.jar</file>
152+
<classifier>${javacpp.platform.linux-x86_64}</classifier>
153+
</artifact>
154+
<artifact>
155+
<file>${project.build.directory}/${artifactId}-${project.version}-${javacpp.platform.linux-x86_64}-gpu.jar</file>
156+
<classifier>${javacpp.platform.linux-x86_64}-gpu</classifier>
157+
</artifact>
158+
<artifact>
159+
<file>${project.build.directory}/${artifactId}-${project.version}-${javacpp.platform.macosx-arm64}.jar</file>
160+
<classifier>${javacpp.platform.macosx-arm64}</classifier>
161+
</artifact>
162+
<artifact>
163+
<file>${project.build.directory}/${artifactId}-${project.version}-${javacpp.platform.macosx-x86_64}.jar</file>
164+
<classifier>${javacpp.platform.macosx-x86_64}</classifier>
165+
</artifact>
166+
<artifact>
167+
<file>${project.build.directory}/${artifactId}-${project.version}-${javacpp.platform.windows-x86_64}.jar</file>
168+
<classifier>${javacpp.platform.windows-x86_64}</classifier>
169+
</artifact>
170+
</artifacts>
171+
</configuration>
172+
</execution>
173+
</executions>
174+
</plugin>
175+
</plugins>
176+
</build>
84177
</profile>
85178

86179
<!-- Generating mode: produce Java files from native resources -->
@@ -220,7 +313,7 @@
220313
<classPath>${project.build.outputDirectory}</classPath>
221314
<includePaths>
222315
<includePath>${dist.download.folder}/tensorflow/include/</includePath>
223-
<includePath>${nativeSourceDirectory}/org/tensorflow/internal/c_api/</includePath>
316+
<includePath>${native.source.directory}/org/tensorflow/internal/c_api/</includePath>
224317
<!-- additional include paths in case of a full native build -->
225318
<includePath>${project.basedir}/bazel-${project.artifactId}/external/org_tensorflow/</includePath>
226319
<includePath>${project.basedir}/bazel-bin/external/org_tensorflow/</includePath>
@@ -530,7 +623,7 @@
530623
<version>3.3.0</version>
531624
<executions>
532625
<execution>
533-
<id>attach-source</id>
626+
<id>attach-sources</id>
534627
<goals>
535628
<goal>jar-no-fork</goal>
536629
</goals>

tensorflow-core/tensorflow-core-platform/pom.xml

+7-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@
4949
<version>${project.version}</version>
5050
<classifier>${javacpp.platform.macosx-arm64.extension}</classifier>
5151
</dependency>
52+
<dependency>
53+
<groupId>org.tensorflow</groupId>
54+
<artifactId>tensorflow-core-native</artifactId>
55+
<version>${project.version}</version>
56+
<classifier>${javacpp.platform.macosx-x86_64.extension}</classifier>
57+
</dependency>
5258
<dependency>
5359
<groupId>org.tensorflow</groupId>
5460
<artifactId>tensorflow-core-native</artifactId>
@@ -67,7 +73,7 @@
6773
<configuration>
6874
<archive>
6975
<manifestEntries>
70-
<Class-Path>tensorflow-core-api.jar tensorflow-core-native-linux-x86_64.jar tensorflow-core-native-macosx-x86_64.jar tensorflow-core-native-windows-x86_64.jar</Class-Path>
76+
<Class-Path>tensorflow-core-api.jar tensorflow-core-native.jar tensorflow-core-native-linux-x86_64.jar tensorflow-core-native-macosx-arm64.jar tensorflow-core-native-macosx-x86_64.jar tensorflow-core-native-windows-x86_64.jar</Class-Path>
7177
<Automatic-Module-Name>${java.module.name}</Automatic-Module-Name>
7278
</manifestEntries>
7379
</archive>

0 commit comments

Comments
 (0)