Class Pom.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.java.Pom.Builder
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Pom.BuilderartifactId(String artifactId)(experimental) The artifactId is generally the name that the project is known by.Pombuild()static Pom.Buildercreate(Project project)Pom.Builderdescription(String description)(experimental) Description of a project is always good.Pom.BuildergroupId(String groupId)(experimental) This is generally unique amongst an organization or a project.Pom.Builderpackaging(String packaging)(experimental) Project packaging format.Pom.BuilderparentPom(ParentPom parentPom)(experimental) A Parent Pom can be used to have a child project inherit properties/plugins/ect in order to reduce duplication and keep standards across a large amount of repos.Pom.Builderurl(String url)(experimental) The URL, like the name, is not required.Pom.Builderversion(String version)(experimental) This is the last piece of the naming puzzle.
-
-
-
Method Detail
-
create
@Stability(Experimental) public static Pom.Builder create(Project project)
- Parameters:
project- This parameter is required.- Returns:
- a new instance of
Pom.Builder.
-
artifactId
@Stability(Experimental) public Pom.Builder artifactId(String artifactId)
(experimental) The artifactId is generally the name that the project is known by.Although the groupId is important, people within the group will rarely mention the groupId in discussion (they are often all be the same ID, such as the MojoHaus project groupId: org.codehaus.mojo). It, along with the groupId, creates a key that separates this project from every other project in the world (at least, it should :) ). Along with the groupId, the artifactId fully defines the artifact's living quarters within the repository. In the case of the above project, my-project lives in $M2_REPO/org/codehaus/mojo/my-project.
Default: "my-app"
- Parameters:
artifactId- The artifactId is generally the name that the project is known by. This parameter is required.- Returns:
this
-
groupId
@Stability(Experimental) public Pom.Builder groupId(String groupId)
(experimental) This is generally unique amongst an organization or a project.For example, all core Maven artifacts do (well, should) live under the groupId org.apache.maven. Group ID's do not necessarily use the dot notation, for example, the junit project. Note that the dot-notated groupId does not have to correspond to the package structure that the project contains. It is, however, a good practice to follow. When stored within a repository, the group acts much like the Java packaging structure does in an operating system. The dots are replaced by OS specific directory separators (such as '/' in Unix) which becomes a relative directory structure from the base repository. In the example given, the org.codehaus.mojo group lives within the directory $M2_REPO/org/codehaus/mojo.
Default: "org.acme"
- Parameters:
groupId- This is generally unique amongst an organization or a project. This parameter is required.- Returns:
this
-
version
@Stability(Experimental) public Pom.Builder version(String version)
(experimental) This is the last piece of the naming puzzle.groupId:artifactId denotes a single project but they cannot delineate which incarnation of that project we are talking about. Do we want the junit:junit of 2018 (version 4.12), or of 2007 (version 3.8.2)? In short: code changes, those changes should be versioned, and this element keeps those versions in line. It is also used within an artifact's repository to separate versions from each other. my-project version 1.0 files live in the directory structure $M2_REPO/org/codehaus/mojo/my-project/1.0.
Default: "0.1.0"
- Parameters:
version- This is the last piece of the naming puzzle. This parameter is required.- Returns:
this
-
description
@Stability(Experimental) public Pom.Builder description(String description)
(experimental) Description of a project is always good.Although this should not replace formal documentation, a quick comment to any readers of the POM is always helpful.
Default: undefined
- Parameters:
description- Description of a project is always good. This parameter is required.- Returns:
this
-
packaging
@Stability(Experimental) public Pom.Builder packaging(String packaging)
(experimental) Project packaging format.Default: "jar"
- Parameters:
packaging- Project packaging format. This parameter is required.- Returns:
this
-
parentPom
@Stability(Experimental) public Pom.Builder parentPom(ParentPom parentPom)
(experimental) A Parent Pom can be used to have a child project inherit properties/plugins/ect in order to reduce duplication and keep standards across a large amount of repos.Default: undefined
- Parameters:
parentPom- A Parent Pom can be used to have a child project inherit properties/plugins/ect in order to reduce duplication and keep standards across a large amount of repos. This parameter is required.- Returns:
this
-
url
@Stability(Experimental) public Pom.Builder url(String url)
(experimental) The URL, like the name, is not required.This is a nice gesture for projects users, however, so that they know where the project lives.
Default: undefined
- Parameters:
url- The URL, like the name, is not required. This parameter is required.- Returns:
this
-
-