Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions temporal-workflowcheck/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Temporal Workflow Check for Java

Temporal workflowcheck is a utility scans Java bytecode looking for workflow implementation methods that do invalid
Temporal workflowcheck is a utility that scans Java bytecode looking for workflow implementation methods that do invalid
things. This mostly centers around
[workflow logic constraints](https://docs.temporal.io/dev-guide/java/foundations#workflow-logic-requirements) that
require workflows are deterministic. Currently it will catch when a workflow method does any of the following:
Expand All @@ -26,8 +26,7 @@ This software is beta quality. We are gathering feedback before considering it s
### Running manually

The all-in-one JAR is best for running manually. Either download the latest version `-all.jar` from
https://repo1.maven.org/maven2/io/temporal/temporal-workflowcheck or build via `gradlew :temporal-workflowcheck:build`
then obtain `-all.jar` in `temporal-workflowcheck/build/libs`.
https://repo1.maven.org/maven2/io/temporal/temporal-workflowcheck or build via `gradlew :temporal-workflowcheck:build` then obtain `-all.jar` in `temporal-workflowcheck/build/libs`.

Simply running the following will show help text:

Expand Down
27 changes: 2 additions & 25 deletions temporal-workflowcheck/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'application'
id 'com.gradleup.shadow' version '8.3.3'
id 'com.gradleup.shadow' version '8.3.9'
id 'java'
}

Expand All @@ -22,36 +22,14 @@ application {
// Need all-in-one JAR
shadowJar {
relocate 'org.objectweb.asm', 'io.temporal.workflowcheck.shaded.org.objectweb.asm'
archiveClassifier = ''
}
Comment on lines 23 to 25
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shadowJar is not configured to be published. While removing the archiveClassifier setting allows the shadowJar to default to the "all" classifier, the shadowJar artifact is not explicitly added to the Maven publication. Without adding the shadowJar to the publication configuration, it will be built but not published to Maven Central.

To publish the shadowJar as a classified artifact, you need to add publishing configuration that includes the shadowJar. For example:

publishing {
    publications {
        mavenJava(MavenPublication) {
            artifact shadowJar
        }
    }
}

Alternatively, you could add it in the afterEvaluate block of the root publishing.gradle for this specific module.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The claim is apparently incorrect for recent versions of Shadow. The plugin wires the shadow JAR into the Java component, so the existing from components.java directive already publishes it.

I confirmed in local publish tests that the -all jar is indeed getting exported.


shadowJar.dependsOn(jar)
build.dependsOn shadowJar
distTar.dependsOn shadowJar
distZip.dependsOn shadowJar
startScripts.dependsOn shadowJar

// Configure publishing to publish both regular library jar and shadow executable jar
publishing {
publications {
// Regular library jar for programmatic usage and compile-time annotations.
// That publication is configured by the default setup in publishing.gradle.
// mavenJava(MavenPublication) { ... }

// Fat executable jar with shaded dependencies
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
artifactId = "${project.name}-all"
artifact sourcesJar
artifact javadocJar
}
}
}

// Fix dependency issue with shadow publication metadata generation
tasks.named('generateMetadataFileForShadowPublication').configure {
dependsOn 'jar'
}

// Copy Java test source files to resources so they can be loaded at runtime
tasks.register('copyJavaSourcesToResources', Copy) {
from('src/test/java') {
Expand All @@ -62,7 +40,6 @@ tasks.register('copyJavaSourcesToResources', Copy) {
}
processTestResources.dependsOn copyJavaSourcesToResources


spotless {
java {
toggleOffOn()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Temporal Workflow Check for Java - Gradle Sample

This sample shows how to incorporate `workflowcheck` into a Gradle build that has multiple projects. Currently there are
no published releases, so this example includes the primary build in the [settings.gradle](settings.gradle) file. But
users may just want to reference a published JAR when it is available.
This sample shows how to incorporate `workflowcheck` into a Gradle build that has multiple projects.

To run:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ configurations {

// Set the dependency
dependencies {
// May want to add :all to the end of the dependency to get the shaded form
workflowcheckDependency 'io.temporal:temporal-workflowcheck:+'
workflowcheckDependency 'io.temporal:temporal-workflowcheck:+:all'
}

// Create the workflowcheck task
Expand Down
5 changes: 1 addition & 4 deletions temporal-workflowcheck/samples/gradle/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Temporal Workflow Check for Java - Gradle Sample

This sample shows how to incorporate `workflowcheck` into a Gradle build. Currently there are no published releases, so
this example includes the primary build in the [settings.gradle](settings.gradle) file. But users may just want to
reference a published JAR when it is available.

This sample shows how to incorporate `workflowcheck` into a Gradle build.
To run:

gradlew check
Expand Down
3 changes: 1 addition & 2 deletions temporal-workflowcheck/samples/gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ configurations {

// Set the dependency
dependencies {
// May want to add :all to the end of the dependency to get the shaded form
workflowcheckDependency 'io.temporal:temporal-workflowcheck:+'
workflowcheckDependency 'io.temporal:temporal-workflowcheck:+:all'
}

// Create the workflowcheck task
Expand Down
4 changes: 0 additions & 4 deletions temporal-workflowcheck/samples/gradle/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
rootProject.name = 'temporal-workflowcheck-samples-gradle'

// Add the workflowcheck project as a composite build. We are only doing this
// for the sample, normally this is not needed.
includeBuild '../../../'
14 changes: 3 additions & 11 deletions temporal-workflowcheck/samples/maven/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
# Temporal Workflow Check for Java - Maven Sample

This sample shows how to incorporate `workflowcheck` into a Maven build. Currently there are no published releases, so
this example expects the primary Gradle to publish the JAR to a local Maven repo that this project references. In the
future, users may just want to reference a published JAR when it is available.
This sample shows how to incorporate `workflowcheck` into a Maven build.

To run, first publish the `workflowcheck` JAR to a local repository. ⚠️ WARNING: While there remain no published
releases of workflowcheck, it is currently undocumented on how to publish to a local/disk Maven repo.
To run, execute the following command from this dir:

Now with the local repository present, can run the following from this dir:

mvn -U verify

Note, this is a sample using the local repository so that's why we have `-U`. For normal use, `mvn verify` without the
`-U` can be used (and the `<pluginRepositories>` section of the `pom.xml` can be removed).
mvn verify

This will output something like:

Expand Down
3 changes: 2 additions & 1 deletion temporal-workflowcheck/samples/maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-workflowcheck</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.33.0</version>
<classifier>all</classifier>
</dependency>
</dependencies>
</plugin>
Expand Down
Loading