maven
Dagger module to build maven Projects
Installation
dagger install github.com/BasisTI/daggerverse/maven@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5Entrypoint
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. |
Example
dagger -m github.com/BasisTI/daggerverse/maven@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker booleanfunc (m *MyModule) Example(buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool) *dagger.Maven {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool) -> dagger.Maven:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean): Maven {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
}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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean imagefunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool) string {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Image(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool) -> str:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.image()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean): Promise<string> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.image()
}useMvnw() 🔗
Use Maven Wrapper
Return Type
Boolean ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean use-mvnwfunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool) bool {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Usemvnw(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool) -> bool:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.usemvnw()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean): Promise<boolean> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.useMvnw()
}useCache() 🔗
Use Cache for Maven repository
Return Type
Boolean ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean use-cachefunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool) bool {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Usecache(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool) -> bool:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.usecache()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean): Promise<boolean> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.useCache()
}useDefaultCiOptions() 🔗
Use default maven parameters for CI builds
Return Type
Boolean ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean use-default-ci-optionsfunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool) bool {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Usedefaultcioptions(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool) -> bool:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.usedefaultcioptions()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean): Promise<boolean> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.useDefaultCiOptions()
}extraOptions() 🔗
Extra maven options, for example properties: “-Dmyprop=1”
Return Type
[String ! ] ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean extra-optionsfunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool) []string {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Extraoptions(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool) -> List[str]:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.extraoptions()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean): Promise<string[]> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean reactor-modefunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool) bool {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Reactormode(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool) -> bool:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.reactormode()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean): Promise<boolean> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.reactorMode()
}useJib() 🔗
Return Type
Boolean ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean use-jibfunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool) bool {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Usejib(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool) -> bool:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.usejib()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean): Promise<boolean> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean use-dockerfunc (m *MyModule) Example(ctx context.Context, buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool) bool {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Usedocker(ctx)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool) -> bool:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.usedocker()
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean): Promise<boolean> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.useDocker()
}container() 🔗
Container ensures a base container exists and returns it for further customization.
Return Type
Container ! Example
dagger -m github.com/BasisTI/daggerverse/maven@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean containerfunc (m *MyModule) Example(buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool) *dagger.Container {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Container()
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool) -> dagger.Container:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.container()
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean): Container {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.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 |
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, source *dagger.Directory, module string, commitSha string, version string) *dagger.MavenModuleBuildResult {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Fullbuild(source, module, commitSha, version)
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, source: dagger.Directory, module: str, commitsha: str, version: str) -> dagger.MavenModuleBuildResult:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.fullbuild(source, module, commitsha, version)
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, source: Directory, module: string, commitSha: string, version: string): MavenModuleBuildResult {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean 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, moduleDir *dagger.Directory) string {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Getversion(ctx, moduleDir)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, moduledir: dagger.Directory) -> str:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.getversion(moduledir)
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, moduleDir: Directory): Promise<string> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean 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, moduleDir *dagger.Directory, defaultVersion string) string {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Getversionordefault(ctx, moduleDir, defaultVersion)
}@function
async def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, moduledir: dagger.Directory, defaultversion: str) -> str:
return await (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.getversionordefault(moduledir, defaultversion)
)@func()
async example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, moduleDir: Directory, defaultVersion: string): Promise<string> {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean new-base-containerfunc (m *MyModule) Example(buildImage string, useMvnw bool, useCache bool, useDefaultCiOptions bool, reactorMode bool, useJib bool, useDocker bool) *dagger.Container {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Newbasecontainer()
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool) -> dagger.Container:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.newbasecontainer()
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean): Container {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean 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, image string, tag string, username string, passwordSecret *dagger.Secret) *dagger.MavenDockerBuildConfig {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Newdockerbuildconfig(image, tag, username, passwordSecret)
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, image: str, tag: str, username: str, passwordsecret: dagger.Secret) -> dagger.MavenDockerBuildConfig:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.newdockerbuildconfig(image, tag, username, passwordsecret)
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, image: string, tag: string, username: string, passwordSecret: Secret): MavenDockerBuildConfig {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.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 |
Example
dagger -m github.com/BasisTI/daggerverse/maven@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean 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, host string, tokenSecret *dagger.Secret, projectId string) *dagger.MavenGitLabConfig {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Newgitlabconfig(host, tokenSecret, projectId)
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, host: str, tokensecret: dagger.Secret, projectid: str) -> dagger.MavenGitLabConfig:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.newgitlabconfig(host, tokensecret, projectid)
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, host: string, tokenSecret: Secret, projectId: string): MavenGitLabConfig {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.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 |
Example
dagger -m github.com/BasisTI/daggerverse/maven@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 call \
--build-image string --use-mvnw boolean --use-cache boolean --use-default-ci-options boolean --reactor-mode boolean --use-jib boolean --use-docker boolean 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, host string, tokenSecret *dagger.Secret, waitForQualityGate bool, extraOptions []string) *dagger.MavenSonarConfig {
return dag.
Maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker).
Newsonarconfig(host, tokenSecret, waitForQualityGate, extraOptions)
}@function
def example(buildimage: str, usemvnw: bool, usecache: bool, usedefaultcioptions: bool, reactormode: bool, usejib: bool, usedocker: bool, host: str, tokensecret: dagger.Secret, waitforqualitygate: bool, extraoptions: List[str]) -> dagger.MavenSonarConfig:
return (
dag.maven(buildimage, usemvnw, usecache, usedefaultcioptions, reactormode, usejib, usedocker)
.newsonarconfig(host, tokensecret, waitforqualitygate, extraoptions)
)@func()
example(buildImage: string, useMvnw: boolean, useCache: boolean, useDefaultCiOptions: boolean, reactorMode: boolean, useJib: boolean, useDocker: boolean, host: string, tokenSecret: Secret, waitForQualityGate: boolean, extraOptions: string[]): MavenSonarConfig {
return dag
.maven(buildImage, useMvnw, useCache, useDefaultCiOptions, reactorMode, useJib, useDocker)
.newSonarConfig(host, tokenSecret, waitForQualityGate, extraOptions)
}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()
}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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 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@b058b47cdf75cfaaa4fd11c4f83520feaed6ffb5 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()
}