← Back to issue list

Java plugin should not copy all jar files

View original Github issue

Metadata

Project
craft-parts
Number
#893
Type
issue
State
open
Author
vpa1977
Labels
—
Created
Updated
Closed
—

Current evaluation

Open design issue: Java plugins still hardlink every built JAR except those under .parts, allowing test artifacts into images; maintainers favor build-system-specific opt-in behavior.

Suggested action: keep open

Reason: JavaPlugin._get_jar_link_commands() still finds every *.jar under CRAFT_PART_BUILD except jars under .parts, confirming the problem remains. Maintainers acknowledged an opt-in approach and a possible 26.04 breaking change, but the reporter noted Maven and Gradle require build-system-specific resolution; stage/dist is only a documented workaround.

Evaluated by: mr-cal-bot

Impact: 50 Quick Win: 6 Complexity: 80 Confidence: 94 Actionability: 58

Issue body

### What needs to get done Java plugin copies all jar files found in the build output. This includes test dependencies which should not be present in the resulting image. Java plugin is unable to distinguish between test and runtime dependencies as it is build-system specific. We need to design a way to determine the test dependencies,. ### Why it needs to get done By default Java plugin deploys all the jar files including test dependencies.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 50
Quick Win: 6
Complexity: 80
Confidence: 94
Actionability: 58
keep open Open design issue: Java plugins still hardlink every built JAR except those under .parts, allowing test artifacts into images; maintainers favor build-system-specific opt-in behavior.
qwen/qwen3.6-35b-a3b
Impact: 40
Quick Win: 8
Complexity: 60
Confidence: 70
Actionability: 50
keep open Java plugin copies all jar files including test dependencies. Maintainers discussed opt-in approach and potential breaking change for 26.04, but no implementation has occurred.
qwen/qwen3.8-27b
Impact: 55
Quick Win: 14
Staleness: 70
Complexity: 75
Confidence: 70
Support Request: 5
keep open Java plugins (ant/maven/gradle) copy every jar from the build dir into the image, including test dependencies. Maintainers discussed an opt-in fix and a 26.04 breaking change; last activity was a documentation suggestion, no implementation yet.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 85
Confidence: 80
Support Request: 10
keep open Java plugin copies test dependencies alongside runtime jars. Maintainers discussed opt-in fixes and breaking changes for 26.04, but implementation stalled. Currently inactive and unlabelled.
qwen3.6-35b-a3b-mtp-q6
Staleness: 80
Complexity: 75
Confidence: 70
Support Request: 10
needs triage Java plugin copies test dependencies into images. Contributors discuss architectural changes, opt-in flags, and documentation workarounds. Currently under discussion with no maintainer labels or assigned action.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.