buildJar builds and returns the generated jar from the user module
( ctx context.Context, ctr *dagger.Container, )
| 327 | |
| 328 | // buildJar builds and returns the generated jar from the user module |
| 329 | func (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. |
no test coverage detected