Skip to content

Commit 280abcd

Browse files
Deploy javadoc, sources (#52)
Signed-off-by: Anders Swanson <anders.swanson@oracle.com>
1 parent e6386d5 commit 280abcd

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ Licensed under the Universal Permissive License v 1.0 as shown at https://oss.or
199199
</configuration>
200200
<executions>
201201
<execution>
202+
<phase>deploy</phase>
202203
<id>attach-javadocs</id>
203204
<goals>
204205
<goal>jar</goal>
@@ -212,6 +213,7 @@ Licensed under the Universal Permissive License v 1.0 as shown at https://oss.or
212213
<version>${maven-source-plugin.version}</version>
213214
<executions>
214215
<execution>
216+
<phase>deploy</phase>
215217
<id>attach-sources</id>
216218
<goals>
217219
<goal>jar</goal>
@@ -333,6 +335,18 @@ Licensed under the Universal Permissive License v 1.0 as shown at https://oss.or
333335
</execution>
334336
</executions>
335337
</plugin>
338+
<plugin>
339+
<artifactId>maven-deploy-plugin</artifactId>
340+
<executions>
341+
<execution>
342+
<id>deploy</id>
343+
<phase>deploy</phase>
344+
<goals>
345+
<goal>deploy</goal>
346+
</goals>
347+
</execution>
348+
</executions>
349+
</plugin>
336350
<!-- Plugin for dependency check -->
337351
<!--<plugin>
338352
<groupId>org.owasp</groupId>

scripts/deploy

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
# Copyright (c) 2024, Oracle and/or its affiliates.
3+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
4+
5+
set -euo pipefail
6+
7+
usage() {
8+
echo "Usage: $0 -v version -u repository.url -r repository.name "
9+
exit 1
10+
}
11+
12+
VERSION=""
13+
REPOSITORY_NAME=""
14+
REPOSITORY_URL=""
15+
16+
if [ -z "$(command -v mvn)" ]; then
17+
echo "Error: 'mvn' binary not found on PATH. Install 'mvn' before running this script."
18+
fi
19+
20+
while getopts ":v:r:u:" opt; do
21+
case $opt in
22+
v) VERSION="$OPTARG";;
23+
u) REPOSITORY_URL="$OPTARG";;
24+
r) REPOSITORY_NAME="$OPTARG";;
25+
\?) echo "Invalid option -$OPTARG" >&2; usage;;
26+
:) echo "Option -$OPTARG requires an argument." >&2; usage;;
27+
esac
28+
done
29+
30+
if [ -z "$VERSION" ] || [ -z "$REPOSITORY_URL" ] || [ -z "$REPOSITORY_NAME" ]; then
31+
echo "Error: -v, -u, and -r options are required."
32+
usage
33+
fi
34+
35+
echo "Setting project version = $VERSION"
36+
37+
mvn -q versions:set -DnewVersion="$VERSION"
38+
cd spring-cloud-oci-dependencies
39+
mvn -q versions:set -DnewVersion="$VERSION"
40+
cd -
41+
cd docs
42+
mvn -q versions:set -DnewVersion="$VERSION"
43+
cd -
44+
45+
echo "Successfully set project version = $VERSION"
46+
47+
echo "Deploying project to ${REPOSITORY_URL}/${REPOSITORY_NAME}"
48+
49+
mvn -q -Drepository.url="$REPOSITORY_URL" -Drepository.name="$REPOSITORY_NAME" -DskipTests
50+
51+
echo "Successfully deployed project to ${REPOSITORY_URL}/${REPOSITORY_NAME}"

0 commit comments

Comments
 (0)