MCPcopy Index your code
hub / github.com/dagger/dagger / buildJar

Method buildJar

sdk/java/runtime/main.go:329–344  ·  view source on GitHub ↗

buildJar builds and returns the generated jar from the user module

(
	ctx context.Context,
	ctr *dagger.Container,
)

Source from the content-addressed store, hash-verified

327
328// buildJar builds and returns the generated jar from the user module
329func (m *JavaSdk) buildJar(
330 ctx context.Context,
331 ctr *dagger.Container,
332) (*dagger.File, error) {
333 return m.finalJar(ctx,
334 ctr.
335 // set the module name as an environment variable so we ensure constructor is only on main object
336 WithEnvVariable(javaSdkModuleNameEnv, m.moduleConfig.name).
337 // build the final jar
338 WithExec(m.mavenCommand(
339 "mvn",
340 "clean",
341 "package",
342 "-DskipTests",
343 )))
344}
345
346// finalJar will return the jar corresponding to the user module built
347// In order to have the final container as minimal as possible, we just want to be able to run a jar.

Callers 1

ModuleRuntimeMethod · 0.95

Calls 4

finalJarMethod · 0.95
mavenCommandMethod · 0.95
WithExecMethod · 0.45
WithEnvVariableMethod · 0.45

Tested by

no test coverage detected