Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: forge/core
...
head fork: forge/core
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 10 files changed
  • 0 commit comments
  • 1 contributor
View
25 addons/src/main/java/org/jboss/forge/addons/ForgeAddonSetupStep.java
@@ -14,6 +14,12 @@
import org.jboss.forge.container.Forge;
import org.jboss.forge.container.addons.AddonId;
import org.jboss.forge.container.repositories.AddonRepository;
+import org.jboss.forge.dependencies.builder.CoordinateBuilder;
+import org.jboss.forge.dependencies.builder.DependencyBuilder;
+import org.jboss.forge.maven.plugins.ExecutionBuilder;
+import org.jboss.forge.maven.plugins.MavenPluginBuilder;
+import org.jboss.forge.maven.plugins.MavenPluginImpl;
+import org.jboss.forge.maven.projects.MavenPluginFacet;
import org.jboss.forge.projects.Project;
import org.jboss.forge.ui.context.UIBuilder;
import org.jboss.forge.ui.context.UIContext;
@@ -23,13 +29,14 @@
import org.jboss.forge.ui.metadata.UICommandMetadata;
import org.jboss.forge.ui.result.NavigationResult;
import org.jboss.forge.ui.result.Result;
+import org.jboss.forge.ui.result.Results;
import org.jboss.forge.ui.util.Categories;
import org.jboss.forge.ui.util.Metadata;
import org.jboss.forge.ui.wizard.UIWizardStep;
/**
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
- *
+ *
*/
public class ForgeAddonSetupStep implements UIWizardStep
{
@@ -59,7 +66,7 @@ public boolean isEnabled(UIContext context)
@Override
public void initializeUI(UIBuilder builder) throws Exception
{
- splitApiImpl.setLabel("Split API and Implementation projects?");
+ splitApiImpl.setLabel("Split API and Implementation projects?").setDefaultValue(Boolean.FALSE);
addons.setLabel("Depend on these addons:");
Set<AddonId> choices = new HashSet<AddonId>();
for (AddonRepository repository : forge.getRepositories())
@@ -83,8 +90,18 @@ public void validate(UIValidationContext validator)
public Result execute(UIContext context) throws Exception
{
Project project = (Project) context.getAttribute(Project.class);
-
- return null;
+ MavenPluginFacet pluginFacet = project.getFacet(MavenPluginFacet.class);
+ if (splitApiImpl.getValue())
+ {
+ }
+ else
+ {
+ }
+ CoordinateBuilder compilerPlugin = CoordinateBuilder.create().setGroupId("org.apache.maven.plugins")
+ .setArtifactId("maven-compiler-plugin");
+
+ MavenPluginBuilder.create(). setDependency(DependencyBuilder.create().setCoordinate(compilerPlugin)).addExecution(ExecutionBuilder.);
+ return Results.success("Forge project created");
}
@Override
View
2  maven/api/src/main/java/org/jboss/forge/maven/plugins/ConfigurationBuilder.java
@@ -10,6 +10,8 @@
import java.util.List;
/**
+ * Builds a {@link Configuration} object
+ *
* @author <a href="mailto:paul.bakker.nl@gmail.com">Paul Bakker</a>
*/
public class ConfigurationBuilder implements Configuration
View
2  maven/api/src/main/java/org/jboss/forge/maven/plugins/ConfigurationElement.java
@@ -18,7 +18,7 @@
boolean isPlugin();
- boolean hasChilderen();
+ boolean hasChildren();
String getText();
View
4 maven/api/src/main/java/org/jboss/forge/maven/plugins/ConfigurationElementBuilder.java
@@ -31,9 +31,9 @@ public boolean isPlugin()
}
@Override
- public boolean hasChilderen()
+ public boolean hasChildren()
{
- return configurationElement.hasChilderen();
+ return configurationElement.hasChildren();
}
@Override
View
4 maven/api/src/main/java/org/jboss/forge/maven/plugins/ConfigurationElementImpl.java
@@ -42,7 +42,7 @@ public boolean isPlugin()
}
@Override
- public boolean hasChilderen()
+ public boolean hasChildren()
{
return children != null && children.size() > 0;
}
@@ -156,7 +156,7 @@ else if (filterType.equals(FilterType.NAME) && filter.equals(element.getName()))
return element;
}
- if (!directChildsOnly && element.hasChilderen())
+ if (!directChildsOnly && element.hasChildren())
{
try
{
View
32 maven/api/src/main/java/org/jboss/forge/maven/plugins/Execution.java
@@ -9,9 +9,31 @@
import java.util.List;
-public interface Execution {
- String getId();
- String getPhase();
- List<String> getGoals();
- Configuration getConfig();
+/**
+ * Represents an <execution> element in the pom.xml
+ *
+ * @author <a href="mailto:ggastald@redhat.com">George Gastaldi</a>
+ *
+ */
+public interface Execution
+{
+ /**
+ * @return the ID of this execution
+ */
+ String getId();
+
+ /**
+ * @return the phase where this execution belongs
+ */
+ String getPhase();
+
+ /**
+ * @return the goals configured for this execution
+ */
+ List<String> getGoals();
+
+ /**
+ * @return the {@link Configuration} object associated with this execution
+ */
+ Configuration getConfig();
}
View
20 maven/api/src/main/java/org/jboss/forge/maven/plugins/MavenPlugin.java
@@ -9,6 +9,7 @@
import java.util.List;
+import org.jboss.forge.dependencies.Coordinate;
import org.jboss.forge.dependencies.Dependency;
/**
@@ -19,14 +20,29 @@
public interface MavenPlugin extends PluginElement
{
- Dependency getDependency();
-
+ /**
+ * Returns the {@link Coordinate} represented by this plugin
+ */
+ Coordinate getCoordinate();
+
+ /**
+ * Returns the {@link Configuration} associated with this plugin, if any
+ */
Configuration getConfig();
+ /**
+ * Return the list of {@link Execution} associated with this plugin, if any
+ */
List<Execution> listExecutions();
+ /**
+ * @return if this plugin extensions is enabled
+ */
boolean isExtensionsEnabled();
+ /**
+ * @return the dependencies for this plugin, if any
+ */
List<Dependency> getDirectDependencies();
}
View
16 maven/api/src/main/java/org/jboss/forge/maven/plugins/MavenPluginAdapter.java
@@ -12,14 +12,18 @@
import java.util.List;
import org.apache.maven.model.Exclusion;
+import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginExecution;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
import org.jboss.forge.dependencies.Coordinate;
import org.jboss.forge.dependencies.Dependency;
+import org.jboss.forge.dependencies.builder.CoordinateBuilder;
import org.jboss.forge.dependencies.builder.DependencyBuilder;
/**
+ * A plugin adapter for {@link Plugin} and {@link MavenPlugin}
+ *
* @author <a href="mailto:paul.bakker.nl@gmail.com">Paul Bakker</a>
*/
@@ -29,11 +33,11 @@
public MavenPluginAdapter(final MavenPlugin mavenPlugin)
{
- Dependency dependency = mavenPlugin.getDependency();
+ Coordinate coordinate = mavenPlugin.getCoordinate();
- setGroupId(dependency.getCoordinate().getGroupId());
- setArtifactId(dependency.getCoordinate().getArtifactId());
- setVersion(dependency.getCoordinate().getVersion());
+ setGroupId(coordinate.getGroupId());
+ setArtifactId(coordinate.getArtifactId());
+ setVersion(coordinate.getVersion());
setConfiguration(parseConfig(mavenPlugin.getConfig()));
setExecutions(transformExecutions(mavenPlugin));
if (mavenPlugin.isExtensionsEnabled())
@@ -152,9 +156,9 @@ public Configuration getConfig()
}
@Override
- public Dependency getDependency()
+ public Coordinate getCoordinate()
{
- return DependencyBuilder.create()
+ return CoordinateBuilder.create()
.setGroupId(getGroupId())
.setArtifactId(getArtifactId())
.setVersion(getVersion());
View
9 maven/api/src/main/java/org/jboss/forge/maven/plugins/MavenPluginBuilder.java
@@ -9,6 +9,7 @@
import java.util.List;
+import org.jboss.forge.dependencies.Coordinate;
import org.jboss.forge.dependencies.Dependency;
/**
@@ -44,14 +45,14 @@ public MavenPluginBuilder setConfiguration(final Configuration configuration)
}
@Override
- public Dependency getDependency()
+ public Coordinate getCoordinate()
{
- return plugin.getDependency();
+ return plugin.getCoordinate();
}
- public MavenPluginBuilder setDependency(final Dependency dependency)
+ public MavenPluginBuilder setCoordinate(final Coordinate coordinate)
{
- plugin.setDependency(dependency);
+ plugin.setCoordinate(coordinate);
return this;
}
View
22 maven/api/src/main/java/org/jboss/forge/maven/plugins/MavenPluginImpl.java
@@ -19,7 +19,7 @@
public class MavenPluginImpl implements MavenPlugin
{
- private Dependency dependency;
+ private Coordinate coordinate;
private Configuration configuration;
private final List<Execution> executions = new ArrayList<Execution>();
private boolean extensions;
@@ -31,19 +31,19 @@ public MavenPluginImpl()
public MavenPluginImpl(final MavenPlugin plugin)
{
- this.dependency = plugin.getDependency();
- this.configuration = plugin.getConfig();
+ setCoordinate(plugin.getCoordinate());
+ setConfiguration(plugin.getConfig());
}
@Override
- public Dependency getDependency()
+ public Coordinate getCoordinate()
{
- return dependency;
+ return coordinate;
}
- public void setDependency(final Dependency dependency)
+ public void setCoordinate(Coordinate coordinate)
{
- this.dependency = dependency;
+ this.coordinate = coordinate;
}
@Override
@@ -78,7 +78,7 @@ public boolean isExtensionsEnabled()
public String toString()
{
StringBuilder b = new StringBuilder("<plugin>");
- appendDependency(b, dependency);
+ appendCoordinates(b, coordinate, true);
if (extensions)
{
@@ -138,7 +138,7 @@ public void addPluginDependency(final Dependency dependency)
private void appendDependency(StringBuilder builder, Dependency appendDependency)
{
- appendDependencyData(builder, appendDependency.getCoordinate(), true);
+ appendCoordinates(builder, appendDependency.getCoordinate(), true);
if (!appendDependency.getExcludedCoordinates().isEmpty())
{
builder.append("<exclusions>");
@@ -153,11 +153,11 @@ private void appendDependency(StringBuilder builder, Dependency appendDependency
private void appendExclusion(StringBuilder builder, Coordinate exclusion)
{
builder.append("<exclusion>");
- appendDependencyData(builder, exclusion, false);
+ appendCoordinates(builder, exclusion, false);
builder.append("</exclusion>");
}
- private void appendDependencyData(StringBuilder builder, Coordinate coordinate, boolean withVersion)
+ private void appendCoordinates(StringBuilder builder, Coordinate coordinate, boolean withVersion)
{
if (coordinate.getGroupId() != null)
{

No commit comments for this range

Something went wrong with that request. Please try again.