maven
Dagger module to build maven Projects
Installation
dagger install github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73dEntrypoint
Return Type
Maven !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| buildImage | String ! | "maven:3.9.11-eclipse-temurin-21" | image for executing Builds. The default is deliberately not the -alpine variant: alpine is musl-based and the node binary frontend-maven-plugin downloads is glibc-linked, so frontend builds die on it. |
| useMvnw | Boolean ! | false | Use Maven Wrapper |
| useCache | Boolean ! | true | Use Cache for Maven repository (true recommended) |
| useDefaultCiOptions | Boolean ! | true | Use default maven parameters for CI builds |
| extraOptions | [String ! ] | - | Extra maven options, for example properties: "-Dmyprop=1" |
| reactorMode | Boolean ! | false | Build the target module from the reactor root, with -pl and -am, instead of mounting the module alone. Required by multi-module projects whose modules depend on sibling modules, and by parents that version themselves through a revision property. |
| useJib | Boolean ! | true | No description provided |
| useDocker | Boolean ! | false | Bind a Docker daemon to the build. Required by test suites that use Testcontainers: the Maven image ships no daemon, and without one they fail with "Could not find a valid Docker environment". Off by default because it costs a dind container per build. |
| sonarPluginVersion | String ! | "5.7.0.6970" | Version of sonar-maven-plugin to run the analysis with. Pinned so a SonarSource release cannot break the pipelines without a commit, and so the scanner stays compatible with the server the org actually runs. |
| nvdApiKey | Secret | - | API key for the NVD API, exported to the build container as NVD_API_KEY. It exists because dependency-check-maven 13+ refuses to query the NVD without a key and aborts the goal, which fails the whole `mvn verify`. The build container is hermetic: a variable set on the CI job does not reach it, so the key has to be handed in explicitly. Passed as a Secret, not a string: Dagger keeps it out of the operation graph and out of the logs, and WithSecretVariable never bakes it into a layer. |
Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version stringfunc (m *MyModule) Example(buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string) *dagger.Maven {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, ) -> dagger.Maven:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, ): Maven {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
}Types
Maven 🔗
Maven models the configuration and reusable container used to run Maven-based builds.
image() 🔗
image for executing Builds
Return Type
String ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string imagefunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string) string {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Image(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, ) -> str:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.image()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, ): Promise<string> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.image()
}useMvnw() 🔗
Use Maven Wrapper
Return Type
Boolean ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string use-mvnwfunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string) bool {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Usemvnw(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, ) -> bool:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.usemvnw()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, ): Promise<boolean> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.useMvnw()
}useCache() 🔗
Use Cache for Maven repository
Return Type
Boolean ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string use-cachefunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string) bool {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Usecache(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, ) -> bool:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.usecache()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, ): Promise<boolean> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.useCache()
}useDefaultCiOptions() 🔗
Use default maven parameters for CI builds
Return Type
Boolean ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string use-default-ci-optionsfunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string) bool {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Usedefaultcioptions(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, ) -> bool:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.usedefaultcioptions()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, ): Promise<boolean> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.useDefaultCiOptions()
}extraOptions() 🔗
Extra maven options, for example properties: “-Dmyprop=1”
Return Type
[String ! ] ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string extra-optionsfunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string) []string {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Extraoptions(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, ) -> List[str]:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.extraoptions()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, ): Promise<string[]> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.extraOptions()
}reactorMode() 🔗
Build the target module from the reactor root instead of in isolation
Return Type
Boolean ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string reactor-modefunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string) bool {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Reactormode(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, ) -> bool:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.reactormode()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, ): Promise<boolean> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.reactorMode()
}useJib() 🔗
Return Type
Boolean ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string use-jibfunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string) bool {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Usejib(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, ) -> bool:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.usejib()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, ): Promise<boolean> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.useJib()
}useDocker() 🔗
Bind a Docker daemon to the build, for test suites that use Testcontainers
Return Type
Boolean ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string use-dockerfunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string) bool {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Usedocker(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, ) -> bool:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.usedocker()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, ): Promise<boolean> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.useDocker()
}sonarPluginVersion() 🔗
Version of sonar-maven-plugin used for the analysis
Return Type
String ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string sonar-plugin-versionfunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string) string {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Sonarpluginversion(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, ) -> str:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.sonarpluginversion()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, ): Promise<string> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.sonarPluginVersion()
}nvdApiKey() 🔗
API key exported to the build as NVD_API_KEY, for OWASP Dependency-Check
Return Type
Secret ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string nvd-api-keyfunc (m *MyModule) Example(buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string) *dagger.Secret {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Nvdapikey()
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, ) -> dagger.Secret:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.nvdapikey()
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, ): Secret {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.nvdApiKey()
}analysisInputs() 🔗
AnalysisInputs recorta de um módulo construído o que a análise do Sonar precisa.
Recebe a Tree do resultado de FullBuild – a árvore do módulo depois do build, com o target/
dele e o de cada módulo filho – e devolve um diretório com os mesmos caminhos relativos ao
módulo, mais o AnalysisChecksumFile, pronto para voltar à árvore por AnalyzeFromReports. O que
entra é decidido pelo conteúdo: ver analysisFilterScript.
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| tree | Directory ! | - | A árvore do módulo, como devolvida em |
Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string analysis-inputs --tree DIR_PATHfunc (m *MyModule) Example(buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string, tree *dagger.Directory) *dagger.Directory {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Analysisinputs(tree)
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, tree: dagger.Directory) -> dagger.Directory:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.analysisinputs(tree)
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, tree: Directory): Directory {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.analysisInputs(tree)
}analysisInputsProblem() 🔗
AnalysisInputsProblem confere um diretório de AnalysisInputs contra o checksum que ele traz e devolve o que está errado, ou texto vazio quando está íntegro. Pega o arquivo truncado, vazio ou trocado que a contagem do manifesto não vê.
O checksum viaja no mesmo artefato: protege contra perda e corrupção, não contra quem reescreve o artefato (ver o README).
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| inputs | Directory ! | - | O diretório de AnalysisInputs, como chegou à análise. |
Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string analysis-inputs-problem --inputs DIR_PATHfunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string, inputs *dagger.Directory) string {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Analysisinputsproblem(ctx, inputs)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, inputs: dagger.Directory) -> str:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.analysisinputsproblem(inputs)
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, inputs: Directory): Promise<string> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.analysisInputsProblem(inputs)
}analyzeFromReports() 🔗
AnalyzeFromReports roda só a análise do Sonar de um módulo, sobre o resultado de um build já feito.
É o par de FullBuild para o job de análise de branch: o verify já rodou no job de publish, e
repeti-lo custa o tempo de todos os testes. Aqui os arquivos de AnalysisInputs voltam à árvore do
módulo e o Maven roda o sonar:sonar – que resolve o classpath das bibliotecas sozinho
(o goal exige resolução de dependências) e não recompila nada.
Quem chama é responsável por só passar inputs do mesmo commit e completos: esta função não os confere. A conferência é do orchestrator, com o manifesto que o publish grava.
Num build comum o sonar:sonar já era uma segunda invocação do Maven sobre o target/ deixado
pela primeira; o que muda é de onde vem esse target/, não o que o scanner enxerga.
Em reactor, as dependências irmãs precisam estar no ~/.m2: um estágio de install sem testes
as garante, e custa pouco quando o cache do build está no mesmo engine.
Return Type
ModuleBuildResult !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| module | String ! | - | Module name. In reactor mode, the module path relative to the reactor root. |
| reports | Directory ! | - | O que AnalysisInputs recortou da árvore do módulo no build. |
| sonarConfig | SonarConfig ! | - | No description provided |
| modulePath | String | - | Caminho do módulo relativo à raiz do repositório; mesma semântica do modulePath de FullBuild. |
Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string, source *dagger.Directory, module string, reports *dagger.Directory, sonarConfig *dagger.MavenSonarConfig) *dagger.MavenModuleBuildResult {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Analyzefromreports(source, module, reports, sonarConfig)
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, source: dagger.Directory, module: str, reports: dagger.Directory, sonarconfig: dagger.MavenSonarConfig) -> dagger.MavenModuleBuildResult:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.analyzefromreports(source, module, reports, sonarconfig)
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, source: Directory, module: string, reports: Directory, sonarConfig: MavenSonarConfig): MavenModuleBuildResult {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.analyzeFromReports(source, module, reports, sonarConfig)
}container() 🔗
Container ensures a base container exists and returns it for further customization.
Return Type
Container ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string containerfunc (m *MyModule) Example(buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string) *dagger.Container {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Container()
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, ) -> dagger.Container:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.container()
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, ): Container {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.container()
}fullBuild() 🔗
FullBuild executes the three-stage pipeline (build/test, Sonar, Docker publish) for a single Maven module.
With ReactorMode off, source is the module directory itself and the module is built in isolation. With ReactorMode on, source is the reactor root and module is the path of the target module inside it.
Return Type
ModuleBuildResult !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| module | String ! | - | Module name. In reactor mode, the module path relative to the reactor root. |
| commitSha | String ! | - | Digest do commit atual (sha completo) |
| version | String ! | - | Versão da aplicação no formato CalVer.BuildNumber |
| sonarConfig | SonarConfig | - | No description provided |
| dockerConfig | DockerBuildConfig | - | No description provided |
| gitlabConfig | GitLabConfig | - | GitLab configuration for reporting commit statuses |
| modulePath | String | - | Caminho do módulo relativo à raiz do repositório. Quando informado, É o que permite ao Sonar fazer blame. O .git vive na raiz do repositório e o índice do git
referencia os arquivos pelo caminho a partir dela, então montar o .git dentro do diretório do
módulo NÃO funciona: o git passaria a resolver Ignorado em ReactorMode, que já monta a raiz por construção. |
Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string, source *dagger.Directory, module string, commitSha string, version string) *dagger.MavenModuleBuildResult {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Fullbuild(source, module, commitSha, version)
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, source: dagger.Directory, module: str, commitsha: str, version: str) -> dagger.MavenModuleBuildResult:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.fullbuild(source, module, commitsha, version)
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, source: Directory, module: string, commitSha: string, version: string): MavenModuleBuildResult {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.fullBuild(source, module, commitSha, version)
}getVersion() 🔗
GetVersion reads pom.xml from the given directory and returns the project version.
In reactor mode the directory is the reactor root, so the POM read here is the parent that declares the version for the whole build; a ${revision} there is resolved against the property, which is where CI-friendly reactors keep the actual number.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| moduleDir | Directory ! | - | No description provided |
Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string get-version --module-dir DIR_PATHfunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string, moduleDir *dagger.Directory) string {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Getversion(ctx, moduleDir)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, moduledir: dagger.Directory) -> str:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.getversion(moduledir)
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, moduleDir: Directory): Promise<string> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.getVersion(moduleDir)
}getVersionOrDefault() 🔗
GetVersionOrDefault returns the module version or the provided default when it cannot be resolved.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| moduleDir | Directory ! | - | No description provided |
| defaultVersion | String ! | - | No description provided |
Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string get-version-or-default --module-dir DIR_PATH --default-version stringfunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string, moduleDir *dagger.Directory, defaultVersion string) string {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Getversionordefault(ctx, moduleDir, defaultVersion)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, moduledir: dagger.Directory, defaultversion: str) -> str:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.getversionordefault(moduledir, defaultversion)
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, moduleDir: Directory, defaultVersion: string): Promise<string> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.getVersionOrDefault(moduleDir, defaultVersion)
}newBaseContainer() 🔗
NewBaseContainer initializes the base container with caches and the optional Docker daemon.
Return Type
Container ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string new-base-containerfunc (m *MyModule) Example(buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string) *dagger.Container {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Newbasecontainer()
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, ) -> dagger.Container:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.newbasecontainer()
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, ): Container {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.newBaseContainer()
}newDockerBuildConfig() 🔗
NewDockerBuildConfig creates a DockerBuildConfig tailored for Maven builds.
Return Type
DockerBuildConfig !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| image | String ! | - | No description provided |
| tag | String ! | - | No description provided |
| username | String ! | - | No description provided |
| passwordSecret | Secret ! | - | No description provided |
Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string new-docker-build-config --image string --tag string --username string --password-secret env:MYSECRETfunc (m *MyModule) Example(buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string, image string, tag string, username string, passwordSecret *dagger.Secret) *dagger.MavenDockerBuildConfig {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Newdockerbuildconfig(image, tag, username, passwordSecret)
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, image: str, tag: str, username: str, passwordsecret: dagger.Secret) -> dagger.MavenDockerBuildConfig:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.newdockerbuildconfig(image, tag, username, passwordsecret)
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, image: string, tag: string, username: string, passwordSecret: Secret): MavenDockerBuildConfig {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.newDockerBuildConfig(image, tag, username, passwordSecret)
}newGitLabConfig() 🔗
NewGitLabConfig validates the provided inputs and returns a GitLab configuration for commit statuses.
Return Type
GitLabConfig !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| host | String ! | - | No description provided |
| tokenSecret | Secret ! | - | No description provided |
| projectId | String ! | - | No description provided |
| ref | String | - | Branch da pipeline que reporta. Sem ela o status terminal pode ser anexado a outra pipeline do mesmo commit, deixando a original travada em “running”. |
Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string new-git-lab-config --host string --token-secret env:MYSECRET --project-id stringfunc (m *MyModule) Example(buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string, host string, tokenSecret *dagger.Secret, projectId string) *dagger.MavenGitLabConfig {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Newgitlabconfig(host, tokenSecret, projectId)
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, host: str, tokensecret: dagger.Secret, projectid: str) -> dagger.MavenGitLabConfig:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.newgitlabconfig(host, tokensecret, projectid)
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, host: string, tokenSecret: Secret, projectId: string): MavenGitLabConfig {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.newGitLabConfig(host, tokenSecret, projectId)
}newSonarConfig() 🔗
NewSonarConfig validates Maven Sonar settings and returns a reusable configuration struct.
Return Type
SonarConfig !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| host | String ! | - | No description provided |
| tokenSecret | Secret ! | - | No description provided |
| waitForQualityGate | Boolean ! | - | No description provided |
| extraOptions | [String ! ] ! | - | No description provided |
| projectKey | String | - | Chave do projeto no SonarQube. Se vazia, FullBuild usa o nome do módulo. |
Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string new-sonar-config --host string --token-secret env:MYSECRET --wait-for-quality-gate boolean --extra-options string1 --extra-options string2func (m *MyModule) Example(buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string, host string, tokenSecret *dagger.Secret, waitForQualityGate bool, extraOptions []string) *dagger.MavenSonarConfig {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Newsonarconfig(host, tokenSecret, waitForQualityGate, extraOptions)
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, host: str, tokensecret: dagger.Secret, waitforqualitygate: bool, extraoptions: List[str]) -> dagger.MavenSonarConfig:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.newsonarconfig(host, tokensecret, waitforqualitygate, extraoptions)
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, host: string, tokenSecret: Secret, waitForQualityGate: boolean, extraOptions: string[]): MavenSonarConfig {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.newSonarConfig(host, tokenSecret, waitForQualityGate, extraOptions)
}securityScan() 🔗
SecurityScan roda mvn clean verify no módulo e devolve os relatórios mesmo quando o build falha.
É o que FullBuild não consegue fazer: lá um exit code diferente de zero vira erro do WithExec e o container – com o target/ dentro – é descartado junto. Numa varredura de segurança o build que falhou é exatamente o que tem relatório a mostrar (failBuildOnCVSS estourado), então o exec roda com Expect=ANY e o código de saída volta como dado, para quem chama decidir o que é falha.
Quem liga o plugin são as ExtraOptions do módulo (o perfil do pom e o formato do relatório); aqui não se sabe nada do Dependency-Check além de onde o relatório cai.
Return Type
SecurityScanResult !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| module | String ! | - | Module name. In reactor mode, the module path relative to the reactor root. |
| modulePath | String | - | Caminho do módulo relativo à raiz do repositório; mesma semântica do modulePath de FullBuild. |
Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean --sonar-plugin-version string security-scan --source DIR_PATH --module stringfunc (m *MyModule) Example(buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool, sonarPluginVersion string, source *dagger.Directory, module string) *dagger.MavenSecurityScanResult {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion).
Securityscan(source, module)
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, sonarpluginversion: str, source: dagger.Directory, module: str) -> dagger.MavenSecurityScanResult:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker, sonarpluginversion)
.securityscan(source, module)
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, sonarPluginVersion: string, source: Directory, module: string): MavenSecurityScanResult {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker, sonarPluginVersion)
.securityScan(source, module)
}ModuleBuildResult 🔗
ModuleBuildResult represents the aggregated outcome of a Maven module build.
artifacts() 🔗
Return Type
Directory ! Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(source *dagger.Directory, module string, commitSha string, version string) *dagger.Directory {
return dag.
Maven().
Fullbuild(source, module, commitSha, version).
Artifacts()
}@function
def example(source: dagger.Directory, module: str, commitsha: str, version: str) -> dagger.Directory:
return (
dag.maven()
.fullbuild(source, module, commitsha, version)
.artifacts()
)@func()
example(source: Directory, module: string, commitSha: string, version: string): Directory {
return dag
.maven()
.fullBuild(source, module, commitSha, version)
.artifacts()
}tree() 🔗
Tree é o diretório do módulo no container depois do último estágio: o pom do módulo, as fontes e o target/ de cada módulo filho. É de onde AnalysisInputs recorta o que a análise lê.
Return Type
Directory ! Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(source *dagger.Directory, module string, commitSha string, version string) *dagger.Directory {
return dag.
Maven().
Fullbuild(source, module, commitSha, version).
Tree()
}@function
def example(source: dagger.Directory, module: str, commitsha: str, version: str) -> dagger.Directory:
return (
dag.maven()
.fullbuild(source, module, commitsha, version)
.tree()
)@func()
example(source: Directory, module: string, commitSha: string, version: string): Directory {
return dag
.maven()
.fullBuild(source, module, commitSha, version)
.tree()
}container() 🔗
Return Type
Container ! Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(source *dagger.Directory, module string, commitSha string, version string) *dagger.Container {
return dag.
Maven().
Fullbuild(source, module, commitSha, version).
Container()
}@function
def example(source: dagger.Directory, module: str, commitsha: str, version: str) -> dagger.Container:
return (
dag.maven()
.fullbuild(source, module, commitsha, version)
.container()
)@func()
example(source: Directory, module: string, commitSha: string, version: string): Container {
return dag
.maven()
.fullBuild(source, module, commitSha, version)
.container()
}imageUrl() 🔗
Return Type
String ! Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(ctx context.Context, source *dagger.Directory, module string, commitSha string, version string) string {
return dag.
Maven().
Fullbuild(source, module, commitSha, version).
Imageurl(ctx)
}@function
async def example(source: dagger.Directory, module: str, commitsha: str, version: str) -> str:
return await (
dag.maven()
.fullbuild(source, module, commitsha, version)
.imageurl()
)@func()
async example(source: Directory, module: string, commitSha: string, version: string): Promise<string> {
return dag
.maven()
.fullBuild(source, module, commitSha, version)
.imageUrl()
}executedStages() 🔗
Return Type
[String ! ] ! Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(ctx context.Context, source *dagger.Directory, module string, commitSha string, version string) []string {
return dag.
Maven().
Fullbuild(source, module, commitSha, version).
Executedstages(ctx)
}@function
async def example(source: dagger.Directory, module: str, commitsha: str, version: str) -> List[str]:
return await (
dag.maven()
.fullbuild(source, module, commitsha, version)
.executedstages()
)@func()
async example(source: Directory, module: string, commitSha: string, version: string): Promise<string[]> {
return dag
.maven()
.fullBuild(source, module, commitSha, version)
.executedStages()
}stdout() 🔗
Return Type
[String ! ] ! Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(ctx context.Context, source *dagger.Directory, module string, commitSha string, version string) []string {
return dag.
Maven().
Fullbuild(source, module, commitSha, version).
Stdout(ctx)
}@function
async def example(source: dagger.Directory, module: str, commitsha: str, version: str) -> List[str]:
return await (
dag.maven()
.fullbuild(source, module, commitsha, version)
.stdout()
)@func()
async example(source: Directory, module: string, commitSha: string, version: string): Promise<string[]> {
return dag
.maven()
.fullBuild(source, module, commitSha, version)
.stdout()
}stderr() 🔗
Return Type
[String ! ] ! Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(ctx context.Context, source *dagger.Directory, module string, commitSha string, version string) []string {
return dag.
Maven().
Fullbuild(source, module, commitSha, version).
Stderr(ctx)
}@function
async def example(source: dagger.Directory, module: str, commitsha: str, version: str) -> List[str]:
return await (
dag.maven()
.fullbuild(source, module, commitsha, version)
.stderr()
)@func()
async example(source: Directory, module: string, commitSha: string, version: string): Promise<string[]> {
return dag
.maven()
.fullBuild(source, module, commitSha, version)
.stderr()
}SonarConfig 🔗
SonarConfig stores the data required to invoke SonarQube analysis for a module.
host() 🔗
Return Type
String ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
new-sonar-config --host string --token-secret env:MYSECRET --wait-for-quality-gate boolean --extra-options string1 --extra-options string2 \
hostfunc (m *MyModule) Example(ctx context.Context, host string, tokenSecret *dagger.Secret, waitForQualityGate bool, extraOptions []string) string {
return dag.
Maven().
Newsonarconfig(host, tokenSecret, waitForQualityGate, extraOptions).
Host(ctx)
}@function
async def example(host: str, tokensecret: dagger.Secret, waitforqualitygate: bool, extraoptions: List[str]) -> str:
return await (
dag.maven()
.newsonarconfig(host, tokensecret, waitforqualitygate, extraoptions)
.host()
)@func()
async example(host: string, tokenSecret: Secret, waitForQualityGate: boolean, extraOptions: string[]): Promise<string> {
return dag
.maven()
.newSonarConfig(host, tokenSecret, waitForQualityGate, extraOptions)
.host()
}tokenSecret() 🔗
Return Type
Secret ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
new-sonar-config --host string --token-secret env:MYSECRET --wait-for-quality-gate boolean --extra-options string1 --extra-options string2 \
token-secretfunc (m *MyModule) Example(host string, tokenSecret *dagger.Secret, waitForQualityGate bool, extraOptions []string) *dagger.Secret {
return dag.
Maven().
Newsonarconfig(host, tokenSecret, waitForQualityGate, extraOptions).
Tokensecret()
}@function
def example(host: str, tokensecret: dagger.Secret, waitforqualitygate: bool, extraoptions: List[str]) -> dagger.Secret:
return (
dag.maven()
.newsonarconfig(host, tokensecret, waitforqualitygate, extraoptions)
.tokensecret()
)@func()
example(host: string, tokenSecret: Secret, waitForQualityGate: boolean, extraOptions: string[]): Secret {
return dag
.maven()
.newSonarConfig(host, tokenSecret, waitForQualityGate, extraOptions)
.tokenSecret()
}projectKey() 🔗
Return Type
String ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
new-sonar-config --host string --token-secret env:MYSECRET --wait-for-quality-gate boolean --extra-options string1 --extra-options string2 \
project-keyfunc (m *MyModule) Example(ctx context.Context, host string, tokenSecret *dagger.Secret, waitForQualityGate bool, extraOptions []string) string {
return dag.
Maven().
Newsonarconfig(host, tokenSecret, waitForQualityGate, extraOptions).
Projectkey(ctx)
}@function
async def example(host: str, tokensecret: dagger.Secret, waitforqualitygate: bool, extraoptions: List[str]) -> str:
return await (
dag.maven()
.newsonarconfig(host, tokensecret, waitforqualitygate, extraoptions)
.projectkey()
)@func()
async example(host: string, tokenSecret: Secret, waitForQualityGate: boolean, extraOptions: string[]): Promise<string> {
return dag
.maven()
.newSonarConfig(host, tokenSecret, waitForQualityGate, extraOptions)
.projectKey()
}waitForQualityGate() 🔗
Return Type
Boolean ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
new-sonar-config --host string --token-secret env:MYSECRET --wait-for-quality-gate boolean --extra-options string1 --extra-options string2 \
wait-for-quality-gatefunc (m *MyModule) Example(ctx context.Context, host string, tokenSecret *dagger.Secret, waitForQualityGate bool, extraOptions []string) bool {
return dag.
Maven().
Newsonarconfig(host, tokenSecret, waitForQualityGate, extraOptions).
Waitforqualitygate(ctx)
}@function
async def example(host: str, tokensecret: dagger.Secret, waitforqualitygate: bool, extraoptions: List[str]) -> bool:
return await (
dag.maven()
.newsonarconfig(host, tokensecret, waitforqualitygate, extraoptions)
.waitforqualitygate()
)@func()
async example(host: string, tokenSecret: Secret, waitForQualityGate: boolean, extraOptions: string[]): Promise<boolean> {
return dag
.maven()
.newSonarConfig(host, tokenSecret, waitForQualityGate, extraOptions)
.waitForQualityGate()
}extraOptions() 🔗
Return Type
[String ! ] ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
new-sonar-config --host string --token-secret env:MYSECRET --wait-for-quality-gate boolean --extra-options string1 --extra-options string2 \
extra-optionsfunc (m *MyModule) Example(ctx context.Context, host string, tokenSecret *dagger.Secret, waitForQualityGate bool, extraOptions []string) []string {
return dag.
Maven().
Newsonarconfig(host, tokenSecret, waitForQualityGate, extraOptions).
Extraoptions(ctx)
}@function
async def example(host: str, tokensecret: dagger.Secret, waitforqualitygate: bool, extraoptions: List[str]) -> List[str]:
return await (
dag.maven()
.newsonarconfig(host, tokensecret, waitforqualitygate, extraoptions)
.extraoptions()
)@func()
async example(host: string, tokenSecret: Secret, waitForQualityGate: boolean, extraOptions: string[]): Promise<string[]> {
return dag
.maven()
.newSonarConfig(host, tokenSecret, waitForQualityGate, extraOptions)
.extraOptions()
}DockerBuildConfig 🔗
DockerBuildConfig contains the information required to execute the Jib Maven plugin and push images.
image() 🔗
Image contains the image name without tag, for instance: registry/group/name
Return Type
String ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
new-docker-build-config --image string --tag string --username string --password-secret env:MYSECRET \
imagefunc (m *MyModule) Example(ctx context.Context, image string, tag string, username string, passwordSecret *dagger.Secret) string {
return dag.
Maven().
Newdockerbuildconfig(image, tag, username, passwordSecret).
Image(ctx)
}@function
async def example(image: str, tag: str, username: str, passwordsecret: dagger.Secret) -> str:
return await (
dag.maven()
.newdockerbuildconfig(image, tag, username, passwordsecret)
.image()
)@func()
async example(image: string, tag: string, username: string, passwordSecret: Secret): Promise<string> {
return dag
.maven()
.newDockerBuildConfig(image, tag, username, passwordSecret)
.image()
}tag() 🔗
Tag image tag
Return Type
String ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
new-docker-build-config --image string --tag string --username string --password-secret env:MYSECRET \
tagfunc (m *MyModule) Example(ctx context.Context, image string, tag string, username string, passwordSecret *dagger.Secret) string {
return dag.
Maven().
Newdockerbuildconfig(image, tag, username, passwordSecret).
Tag(ctx)
}@function
async def example(image: str, tag: str, username: str, passwordsecret: dagger.Secret) -> str:
return await (
dag.maven()
.newdockerbuildconfig(image, tag, username, passwordsecret)
.tag()
)@func()
async example(image: string, tag: string, username: string, passwordSecret: Secret): Promise<string> {
return dag
.maven()
.newDockerBuildConfig(image, tag, username, passwordSecret)
.tag()
}username() 🔗
Username to connect to a private registry
Return Type
String ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
new-docker-build-config --image string --tag string --username string --password-secret env:MYSECRET \
usernamefunc (m *MyModule) Example(ctx context.Context, image string, tag string, username string, passwordSecret *dagger.Secret) string {
return dag.
Maven().
Newdockerbuildconfig(image, tag, username, passwordSecret).
Username(ctx)
}@function
async def example(image: str, tag: str, username: str, passwordsecret: dagger.Secret) -> str:
return await (
dag.maven()
.newdockerbuildconfig(image, tag, username, passwordsecret)
.username()
)@func()
async example(image: string, tag: string, username: string, passwordSecret: Secret): Promise<string> {
return dag
.maven()
.newDockerBuildConfig(image, tag, username, passwordSecret)
.username()
}passwordSecret() 🔗
Password for the user to connect to a private registry
Return Type
Secret ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
new-docker-build-config --image string --tag string --username string --password-secret env:MYSECRET \
password-secretfunc (m *MyModule) Example(image string, tag string, username string, passwordSecret *dagger.Secret) *dagger.Secret {
return dag.
Maven().
Newdockerbuildconfig(image, tag, username, passwordSecret).
Passwordsecret()
}@function
def example(image: str, tag: str, username: str, passwordsecret: dagger.Secret) -> dagger.Secret:
return (
dag.maven()
.newdockerbuildconfig(image, tag, username, passwordsecret)
.passwordsecret()
)@func()
example(image: string, tag: string, username: string, passwordSecret: Secret): Secret {
return dag
.maven()
.newDockerBuildConfig(image, tag, username, passwordSecret)
.passwordSecret()
}GitLabConfig 🔗
GitLabConfig stores the data needed to report commit statuses to GitLab.
host() 🔗
URL base (ex: “https://gitlab.com”)
Return Type
String ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
new-git-lab-config --host string --token-secret env:MYSECRET --project-id string \
hostfunc (m *MyModule) Example(ctx context.Context, host string, tokenSecret *dagger.Secret, projectId string) string {
return dag.
Maven().
Newgitlabconfig(host, tokenSecret, projectId).
Host(ctx)
}@function
async def example(host: str, tokensecret: dagger.Secret, projectid: str) -> str:
return await (
dag.maven()
.newgitlabconfig(host, tokensecret, projectid)
.host()
)@func()
async example(host: string, tokenSecret: Secret, projectId: string): Promise<string> {
return dag
.maven()
.newGitLabConfig(host, tokenSecret, projectId)
.host()
}tokenSecret() 🔗
Token com scope
api
Return Type
Secret ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
new-git-lab-config --host string --token-secret env:MYSECRET --project-id string \
token-secretfunc (m *MyModule) Example(host string, tokenSecret *dagger.Secret, projectId string) *dagger.Secret {
return dag.
Maven().
Newgitlabconfig(host, tokenSecret, projectId).
Tokensecret()
}@function
def example(host: str, tokensecret: dagger.Secret, projectid: str) -> dagger.Secret:
return (
dag.maven()
.newgitlabconfig(host, tokensecret, projectid)
.tokensecret()
)@func()
example(host: string, tokenSecret: Secret, projectId: string): Secret {
return dag
.maven()
.newGitLabConfig(host, tokenSecret, projectId)
.tokenSecret()
}projectId() 🔗
ID numérico ou path URL-encoded
Return Type
String ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
new-git-lab-config --host string --token-secret env:MYSECRET --project-id string \
project-idfunc (m *MyModule) Example(ctx context.Context, host string, tokenSecret *dagger.Secret, projectId string) string {
return dag.
Maven().
Newgitlabconfig(host, tokenSecret, projectId).
Projectid(ctx)
}@function
async def example(host: str, tokensecret: dagger.Secret, projectid: str) -> str:
return await (
dag.maven()
.newgitlabconfig(host, tokensecret, projectid)
.projectid()
)@func()
async example(host: string, tokenSecret: Secret, projectId: string): Promise<string> {
return dag
.maven()
.newGitLabConfig(host, tokenSecret, projectId)
.projectId()
}ref() 🔗
Branch da pipeline (ex: CI_COMMIT_REF_NAME)
Return Type
String ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
new-git-lab-config --host string --token-secret env:MYSECRET --project-id string \
reffunc (m *MyModule) Example(ctx context.Context, host string, tokenSecret *dagger.Secret, projectId string) string {
return dag.
Maven().
Newgitlabconfig(host, tokenSecret, projectId).
Ref(ctx)
}@function
async def example(host: str, tokensecret: dagger.Secret, projectid: str) -> str:
return await (
dag.maven()
.newgitlabconfig(host, tokensecret, projectid)
.ref()
)@func()
async example(host: string, tokenSecret: Secret, projectId: string): Promise<string> {
return dag
.maven()
.newGitLabConfig(host, tokenSecret, projectId)
.ref()
}SecurityScanResult 🔗
SecurityScanResult é o desfecho de uma varredura: os relatórios e o código de saída do mvn.
reports() 🔗
Relatórios do Dependency-Check, com o caminho relativo à árvore montada preservado (ex:
target/dependency-check-report.html,target/dependency-check-junit.xml, ou<módulo>/target/...num reactor).
Return Type
Directory ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
security-scan --source DIR_PATH --module string \
reportsfunc (m *MyModule) Example(source *dagger.Directory, module string) *dagger.Directory {
return dag.
Maven().
Securityscan(source, module).
Reports()
}@function
def example(source: dagger.Directory, module: str) -> dagger.Directory:
return (
dag.maven()
.securityscan(source, module)
.reports()
)@func()
example(source: Directory, module: string): Directory {
return dag
.maven()
.securityScan(source, module)
.reports()
}exitCode() 🔗
Código de saída do
mvn verify. Zero é sucesso.
Return Type
Integer ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b9f6452c992e52bc23264f0d5084aca7dad7a73d call \
security-scan --source DIR_PATH --module string \
exit-codefunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, module string) int {
return dag.
Maven().
Securityscan(source, module).
Exitcode(ctx)
}@function
async def example(source: dagger.Directory, module: str) -> int:
return await (
dag.maven()
.securityscan(source, module)
.exitcode()
)@func()
async example(source: Directory, module: string): Promise<number> {
return dag
.maven()
.securityScan(source, module)
.exitCode()
}