Skip to content

Fix TOOLS_JAVA_VERSION export in Dockerfile#296

Merged
goneall merged 1 commit into
spdx:masterfrom
bact:fix-dockerfile
Jul 19, 2026
Merged

Fix TOOLS_JAVA_VERSION export in Dockerfile#296
goneall merged 1 commit into
spdx:masterfrom
bact:fix-dockerfile

Conversation

@bact

@bact bact commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator
  • In Dockerfile, env vars in one RUN didn't last to another RUN.
    So in our case, TOOLS_JAVA_VERSION is lost and breaks the @@VERSION@@ substitution for the scripts/tools-java-wrapper.sh -- producing tools-java--jar-with-dependencies.jar (missing version, double dash), causing error.
  • Removes no-op source=$PWD on the bind mount.
    $PWD is not a recognized variable in Dockerfile, always empty.
    (No change in behavior, as default is the build context root. Just a cleanup to avoid confusion)

To fix #295

Also remove the no-ops $PWD

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
@bact bact added the bug Something isn't working label Jul 16, 2026
@bact

bact commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator Author

@kzantow please help verify at your convenience. thank you.

@kzantow

kzantow commented Jul 16, 2026

Copy link
Copy Markdown

Thanks @bact -- I can confirm the Dockerfile built locally works for me:

% docker build -t tools-java-fix .
...
% docker run tools-java-fix  
Usage: java -jar spdx-tools-jar-with-dependencies.jar <function> <parameters> 
function                 parameter                         example 
------------------------------------------------------------------------------------------------------------------- 
Convert         inputFile outputFile [fromType] [toType]   Examples/SPDXTagExample.tag TagToSpreadsheet.xls 
SPDXViewer      inputFile                                  TestFiles/SPDXRdfExample.rdf 
Verify          inputFile [type]                           TestFiles/SPDXRdfExample.rdf 
CompareDocs     output.xlsx doc1 doc2 ... docN 
GenerateVerificationCode sourceDirectory
Version
MatchingStandardLicenses licenseTextFile

It looks like the version was removed from the jar, which seems like a simple fix but I'm not sure if there's a way to confirm the result of the workflow

@bact

bact commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator Author

It looks like the version was removed from the jar, which seems like a simple fix but I'm not sure if there's a way to confirm the result of the workflow

If you mean the "spdx-tools-jar-with-dependencies.jar" in the usage, it is hard-coded here:

System.out.println("Usage: java -jar spdx-tools-jar-with-dependencies.jar <function> <parameters> \n"

To see if the jar is properly named with expected version number, you can try:

docker run --rm --entrypoint sh tools-java-fix -c 'ls /usr/lib/java/spdx/*.jar' 

To see if the version number is properly substituted in the tools-java wrapper:

docker run --rm --entrypoint sh tools-java-fix -c 'cat /usr/bin/tools-java'

These are checks that included in the smoke test, proposed in this PR: #298 -- should help prevent this issue in the future.

@goneall
goneall merged commit c4bffd5 into spdx:master Jul 19, 2026
2 checks passed
@bact
bact deleted the fix-dockerfile branch July 19, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Images after 2.0.4 no longer work

3 participants