Skip to content

[MRESOLVER-43] Enhancements to the public API to add support for trac… #17

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion maven-resolver-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver</artifactId>
<version>1.1.2-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</parent>

<artifactId>maven-resolver-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,61 @@

/**
* The management updates to apply to a dependency.
*
*
* @see DependencyManager#manageDependency(Dependency)
*/
public final class DependencyManagement
{

private String version;

/**
* @since 1.2.0
*/
private String versionSourceHint;

private String scope;

/**
* @since 1.2.0
*/
private String scopeSourceHint;

private Boolean optional;

/**
* @since 1.2.0
*/
private String optionalSourceHint;

private Collection<Exclusion> exclusions;

/**
* @since 1.2.0
*/
private String exclusionsSourceHint;

private Map<String, String> properties;

/**
* @since 1.2.0
*/
private String propertiesSourceHint;

/**
* Creates an empty management update.
*/
public DependencyManagement()
{
// enables default constructor
super();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the super if we don't extend anything?

}

/**
* Gets the new version to apply to the dependency.
*
*
* @return The new version or {@code null} if the version is not managed and the existing dependency version should
* remain unchanged.
* remain unchanged.
*/
public String getVersion()
{
Expand All @@ -64,7 +90,7 @@ public String getVersion()

/**
* Sets the new version to apply to the dependency.
*
*
* @param version The new version, may be {@code null} if the version is not managed.
* @return This management update for chaining, never {@code null}.
*/
Expand All @@ -74,11 +100,33 @@ public DependencyManagement setVersion( String version )
return this;
}

/**
* Gets an informational hint describing the source declaring the version management.
* @return An informational hint describing the source declaring the version management or {@code null}.
* @since 1.2.0
*/
public String getVersionSourceHint()
{
return this.versionSourceHint;
}

/**
* Sets the informational hint describing the source declaring the version management.
* @param value The new informational hint decsribing the source declaring the version management or {@code null}.
* @return This management update for chaining, never {@code null}.
* @since 1.2.0
*/
public DependencyManagement setVersionSourceHint( final String value )
{
this.versionSourceHint = value;
return this;
}

/**
* Gets the new scope to apply to the dependency.
*
*
* @return The new scope or {@code null} if the scope is not managed and the existing dependency scope should remain
* unchanged.
* unchanged.
*/
public String getScope()
{
Expand All @@ -87,7 +135,7 @@ public String getScope()

/**
* Sets the new scope to apply to the dependency.
*
*
* @param scope The new scope, may be {@code null} if the scope is not managed.
* @return This management update for chaining, never {@code null}.
*/
Expand All @@ -97,11 +145,33 @@ public DependencyManagement setScope( String scope )
return this;
}

/**
* Gets an informational hint describing the source declaring the scope management.
* @return An informational hint describing the source declaring the scope management or {@code null}.
* @since 1.2.0
*/
public String getScopeSourceHint()
{
return this.scopeSourceHint;
}

/**
* Sets the informational hint describing the source declaring the scope management.
* @param value The new informational hint decsribing the source declaring the scope management or {@code null}.
* @return This management update for chaining, never {@code null}.
* @since 1.2.0
*/
public DependencyManagement setScopeSourceHint( final String value )
{
this.scopeSourceHint = value;
return this;
}

/**
* Gets the new optional flag to apply to the dependency.
*
*
* @return The new optional flag or {@code null} if the flag is not managed and the existing optional flag of the
* dependency should remain unchanged.
* dependency should remain unchanged.
*/
public Boolean getOptional()
{
Expand All @@ -110,7 +180,7 @@ public Boolean getOptional()

/**
* Sets the new optional flag to apply to the dependency.
*
*
* @param optional The optional flag, may be {@code null} if the flag is not managed.
* @return This management update for chaining, never {@code null}.
*/
Expand All @@ -120,13 +190,36 @@ public DependencyManagement setOptional( Boolean optional )
return this;
}

/**
* Gets an informational hint describing the source declaring the optionality management.
* @return An informational hint describing the source declaring the optionality management or {@code null}.
* @since 1.2.0
*/
public String getOptionalitySourceHint()
{
return this.optionalSourceHint;
}

/**
* Sets the informational hint describing the source declaring the optionality management.
* @param value The new informational hint decsribing the source declaring the optionality management or
* {@code null}.
* @return This management update for chaining, never {@code null}.
* @since 1.2.0
*/
public DependencyManagement setOptionalitySourceHint( final String value )
{
this.optionalSourceHint = value;
return this;
}

/**
* Gets the new exclusions to apply to the dependency. Note that this collection denotes the complete set of
* exclusions for the dependency, i.e. the dependency manager controls whether any existing exclusions get merged
* with information from dependency management or overridden by it.
*
*
* @return The new exclusions or {@code null} if the exclusions are not managed and the existing dependency
* exclusions should remain unchanged.
* exclusions should remain unchanged.
*/
public Collection<Exclusion> getExclusions()
{
Expand All @@ -137,7 +230,7 @@ public Collection<Exclusion> getExclusions()
* Sets the new exclusions to apply to the dependency. Note that this collection denotes the complete set of
* exclusions for the dependency, i.e. the dependency manager controls whether any existing exclusions get merged
* with information from dependency management or overridden by it.
*
*
* @param exclusions The new exclusions, may be {@code null} if the exclusions are not managed.
* @return This management update for chaining, never {@code null}.
*/
Expand All @@ -147,13 +240,36 @@ public DependencyManagement setExclusions( Collection<Exclusion> exclusions )
return this;
}

/**
* Gets an informational hint describing the source declaring the exclusions management.
* @return An informational hint describing the source declaring the exclusions management or {@code null}.
* @since 1.2.0
*/
public String getExclusionsSourceHint()
{
return this.exclusionsSourceHint;
}

/**
* Sets the informational hint describing the source declaring the exclusions management.
* @param value The new informational hint decsribing the source declaring the exclusions management or
* {@code null}.
* @return This management update for chaining, never {@code null}.
* @since 1.2.0
*/
public DependencyManagement setExclusionsSourceHint( final String value )
{
this.exclusionsSourceHint = value;
return this;
}

/**
* Gets the new properties to apply to the dependency. Note that this map denotes the complete set of properties,
* i.e. the dependency manager controls whether any existing properties get merged with the information from
* dependency management or overridden by it.
*
*
* @return The new artifact properties or {@code null} if the properties are not managed and the existing properties
* should remain unchanged.
* should remain unchanged.
*/
public Map<String, String> getProperties()
{
Expand All @@ -164,7 +280,7 @@ public Map<String, String> getProperties()
* Sets the new properties to apply to the dependency. Note that this map denotes the complete set of properties,
* i.e. the dependency manager controls whether any existing properties get merged with the information from
* dependency management or overridden by it.
*
*
* @param properties The new artifact properties, may be {@code null} if the properties are not managed.
* @return This management update for chaining, never {@code null}.
*/
Expand All @@ -174,4 +290,27 @@ public DependencyManagement setProperties( Map<String, String> properties )
return this;
}

/**
* Gets an informational hint describing the source declaring the properties management.
* @return An informational hint describing the source declaring the properties management or {@code null}.
* @since 1.2.0
*/
public String getPropertiesSourceHint()
{
return this.propertiesSourceHint;
}

/**
* Sets the informational hint describing the source declaring the properties management.
* @param value The new informational hint decsribing the source declaring the properties management or
* {@code null}.
* @return This management update for chaining, never {@code null}.
* @since 1.2.0
*/
public DependencyManagement setPropertiesSourceHint( final String value )
{
this.propertiesSourceHint = value;
return this;
}

}
Loading