Skip to content

Commit 16c6625

Browse files
committed
Fix publishing to maven
1 parent 1212361 commit 16c6625

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

bin/releaser.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,10 @@ def deploy_maven_platform(release: str, platform: str, snapshot: bool):
446446
f"-Dproject.suffix='{'-SNAPSHOT' if snapshot else ''}' -f {pom} clean deploy"
447447
try:
448448
subprocess.check_call(cmd, shell=True, cwd=CURRENT_DIR,
449-
stdout=subprocess.DEVNULL,
450-
stderr=subprocess.DEVNULL) # os.system(f"cd {CURRENT_DIR}; {cmd}")
451-
except subprocess.CalledProcessError:
452-
os.system(f"cd {CURRENT_DIR}; {cmd}")
453-
raise
449+
stdout=subprocess.PIPE,
450+
stderr=subprocess.PIPE) # os.system(f"cd {CURRENT_DIR}; {cmd}")
451+
except BaseException as ex:
452+
raise Exception(f"Error deploying {release}-{SUB_VERSION} for {platform} to maven: {ex}, cwd: {CURRENT_DIR}, cmd: {cmd}")
454453

455454

456455
def deploy_maven(release: str, snapshot: bool = True):
@@ -527,7 +526,8 @@ def clear():
527526

528527
def parse_cli_args() -> Tuple[List[str], Optional[str]]:
529528
available_commands = ["current_version", "versions", "download", "build",
530-
"test", "deploy_mvn", "deploy_gh", "deploy",
529+
"test", "deploy_mvn", "deploy_mvn_release",
530+
"deploy_gh", "deploy",
531531
"deploy_release", "clear"]
532532
commands = []
533533
release = sys.argv[-1] if sys.argv[-1][0].isnumeric() else None
@@ -554,6 +554,7 @@ def cli():
554554
"build": lambda: build_release(release),
555555
"test": lambda: test_release(release),
556556
"deploy_mvn": lambda: deploy_maven(release),
557+
"deploy_mvn_release": lambda: deploy_maven(release, snapshot=False),
557558
"deploy_gh": lambda: deploy_github(release),
558559
"deploy": lambda: deploy(release, snapshot=True),
559560
"deploy_release": lambda: deploy(release, snapshot=False),

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
<executions>
165165
<execution>
166166
<id>attach-javadoc</id>
167-
<phase>deploy</phase>
167+
<phase>package</phase>
168168
<goals>
169169
<goal>jar</goal>
170170
</goals>
@@ -234,7 +234,7 @@
234234
<plugin>
235235
<groupId>org.sonatype.central</groupId>
236236
<artifactId>central-publishing-maven-plugin</artifactId>
237-
<version>0.6.0</version><!-- Check for latest version at Maven Central -->
237+
<version>0.7.0</version>
238238
<extensions>true</extensions>
239239
<configuration>
240240
<publishingServerId>ossrh</publishingServerId>

pom_all.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
<executions>
154154
<execution>
155155
<id>attach-javadoc</id>
156-
<phase>deploy</phase>
156+
<phase>package</phase>
157157
<goals>
158158
<goal>jar</goal>
159159
</goals>
@@ -223,7 +223,7 @@
223223
<plugin>
224224
<groupId>org.sonatype.central</groupId>
225225
<artifactId>central-publishing-maven-plugin</artifactId>
226-
<version>0.6.0</version><!-- Check for latest version at Maven Central -->
226+
<version>0.7.0</version>
227227
<extensions>true</extensions>
228228
<configuration>
229229
<publishingServerId>ossrh</publishingServerId>

0 commit comments

Comments
 (0)