Skip to content

Commit

Permalink
FORGE-1087: Moved removeProperty from DependencyFacet to MetadataFacet
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Aug 5, 2013
1 parent 7d0eee1 commit c364dca
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Properties;

import javax.enterprise.context.Dependent;
import javax.inject.Inject;
Expand Down Expand Up @@ -341,18 +340,6 @@ public Dependency resolveProperties(final Dependency dependency)
return builder;
}

@Override
public String removeProperty(final String name)
{
MavenFacet maven = getFaceted().getFacet(MavenFacet.class);
Model pom = maven.getPOM();

Properties properties = pom.getProperties();
String result = (String) properties.remove(name);
maven.setPOM(pom);
return result;
}

@Override
public List<Coordinate> resolveAvailableVersions(final String gavs)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,17 @@ public String getEffectiveProperty(final String name)
{
return getEffectiveProperties().get(name);
}

@Override
public String removeProperty(final String name)
{
MavenFacet maven = getFaceted().getFacet(MavenFacet.class);
Model pom = maven.getPOM();

Properties properties = pom.getProperties();
String result = (String) properties.remove(name);
maven.setPOM(pom);
return result;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,6 @@ public interface DependencyFacet extends ProjectFacet
*/
public void removeManagedDependency(Dependency managedDependency);

/**
* Remove a build property by name. (Build properties, such as ${my.version}, can be used anywhere in a dependency,
* and will be expanded during building to their property value.)
*/
public String removeProperty(String name);

/**
* Remove the given {@link DependencyRepository} from the current project. Return true if the repository was removed;
* return false otherwise. Return the removed repository, or null if no repository was removed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,11 @@ public interface MetadataFacet extends ProjectFacet
* during building to the resolved property value.
*/
public void setProperty(String name, String value);

/**
* Remove a build property by name. (Build properties, such as ${my.version}, can be used anywhere in a dependency,
* and will be expanded during building to their property value.)
*/
public String removeProperty(String name);

}

0 comments on commit c364dca

Please sign in to comment.