Permalink
Browse files

Improved facets in addons

  • Loading branch information...
1 parent f06d929 commit b70dcf5d28ed7c87bfe05556cffb886beda166e0 @gastaldi gastaldi committed Apr 11, 2013
@@ -6,11 +6,8 @@
*/
package org.jboss.forge.addons;
-import javax.inject.Inject;
-
import org.jboss.forge.dependencies.builder.CoordinateBuilder;
import org.jboss.forge.facets.AbstractFacet;
-import org.jboss.forge.facets.FacetFactory;
import org.jboss.forge.maven.plugins.ConfigurationBuilder;
import org.jboss.forge.maven.plugins.ConfigurationElementBuilder;
import org.jboss.forge.maven.plugins.ExecutionBuilder;
@@ -22,25 +19,14 @@
/**
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
- *
+ *
*/
public class ForgeAddonFacet extends AbstractFacet<Project> implements ProjectFacet
{
- @Inject
- private FacetFactory factory;
@Override
public boolean install()
{
- Project project = getOrigin();
-
- // TODO: Implement and change to @RequiresFacet
- if (!project.hasFacet(MavenPluginFacet.class))
- {
- MavenPluginFacet facet = factory.create(MavenPluginFacet.class, project);
- project.install(facet);
- }
-
MavenPluginFacet pluginFacet = getOrigin().getFacet(MavenPluginFacet.class);
MavenPlugin forgeAddon = MavenPluginBuilder
.create()
@@ -65,10 +51,4 @@ public boolean isInstalled()
{
return false;
}
-
- @Override
- public void setOrigin(Project origin)
- {
- super.setOrigin(origin);
- }
}
@@ -18,7 +18,7 @@
/**
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
- *
+ *
*/
public class ForgeSimpleAddonFacet extends AbstractFacet<Project> implements ProjectFacet
{
@@ -27,11 +27,11 @@
@Inject
private DependencyInstaller installer;
-
+
@Override
public boolean install()
{
- return false;
+ return true;
}
@Override
@@ -40,10 +40,4 @@ public boolean isInstalled()
DependencyFacet dependencies = origin.getFacet(DependencyFacet.class);
return dependencies != null && dependencies.hasEffectiveDependency(forgeApi);
}
-
- @Override
- public void setOrigin(Project origin)
- {
- super.setOrigin(origin);
- }
}

0 comments on commit b70dcf5

Please sign in to comment.