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

[MNG-8072] add ConsumerPomFile methods #1437

Open
wants to merge 1 commit into
base: maven-3.9.x
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ public class MavenProject implements Cloneable {

private File file;

private File consumerPomFile;

private File basedir;

private Set<Artifact> resolvedArtifacts;
Expand Down Expand Up @@ -256,6 +258,17 @@ public void setPomFile(File file) {
this.file = file;
}

public void setConsumerPomFile(File file) {
this.consumerPomFile = file;
}

public File getConsumerPomFile() {
if (consumerPomFile == null) {
return getFile();
}
return consumerPomFile;
}

public File getBasedir() {
return basedir;
}
Expand Down Expand Up @@ -784,6 +797,7 @@ public Map<String, List<String>> getInjectedProfileIds() {
* @deprecated Please use {@link MavenProjectHelper}
* @throws DuplicateArtifactAttachmentException will never happen but leave it for backward compatibility
*/
@Deprecated
public void addAttachedArtifact(Artifact artifact) throws DuplicateArtifactAttachmentException {
// if already there we remove it and add again
int index = attachedArtifacts.indexOf(artifact);
Expand Down Expand Up @@ -1026,6 +1040,7 @@ private void deepCopy(MavenProject project) {

// copy fields
file = project.file;
this.consumerPomFile = project.consumerPomFile;
basedir = project.basedir;

// don't need a deep copy, they don't get modified or added/removed to/from - but make them unmodifiable to be
Expand Down