Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make more elements configurable in pomElements #370

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions src/main/java/org/codehaus/mojo/flatten/FlattenDescriptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,48 @@ public void setHandling(PomProperty<?> property, ElementHandling handling) {
this.name2handlingMap.put(property.getName(), handling);
}

/**
* @return {@link ElementHandling} for {@link Model#getArtifactId() artifactId}.
*/
public ElementHandling getArtifactId() {
return getHandling(PomProperty.ARTIFACT_ID);
}

/**
* @param artifactId the {@link #setArtifactId(ElementHandling) artifactId} to set.
*/
public void setArtifactId(ElementHandling artifactId) {
setHandling(PomProperty.ARTIFACT_ID, artifactId);
}

/**
* @return {@link ElementHandling} for {@link Model#getGroupId() groupId}.
*/
public ElementHandling getGroupId() {
return getHandling(PomProperty.GROUP_ID);
}

/**
* @param groupId the {@link #setGroupId(ElementHandling) groupId} to set.
*/
public void setGroupId(ElementHandling groupId) {
setHandling(PomProperty.GROUP_ID, groupId);
}

/**
* @return {@link ElementHandling} for {@link Model#getPackaging() packaging}.
*/
public ElementHandling getPackaging() {
return getHandling(PomProperty.PACKAGING);
}

/**
* @param packaging the {@link #setPackaging(ElementHandling) packaging} to set.
*/
public void setPackaging(ElementHandling packaging) {
setHandling(PomProperty.PACKAGING, packaging);
}

/**
* @return {@link ElementHandling} for {@link Model#getName() name}.
*/
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/codehaus/mojo/flatten/FlattenMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ public FlattenDescriptor getDescriptor() {
descriptor.setMailingLists(ElementHandling.interpolate);
descriptor.setModules(ElementHandling.interpolate);
descriptor.setName(ElementHandling.interpolate);
descriptor.setArtifactId(ElementHandling.interpolate);
descriptor.setGroupId(ElementHandling.interpolate);
descriptor.setPackaging(ElementHandling.interpolate);
descriptor.setOrganization(ElementHandling.interpolate);
descriptor.setParent(ElementHandling.resolve);
descriptor.setPluginManagement(ElementHandling.interpolate);
Expand Down