]
Claus Ibsen commented on FORGE-2181:
------------------------------------
This ticket is less important as the functionality works. You can lookup the facets using
the interface name. Its just the command that list them using a mix of class and interface
names.
Maybe its those facets itself that has some difference how they are configured/developed
that makes one register using class name and others using the interface name?
Anyway feel free to close this in case its "no biggie"
Facet are installed using a mix of interface and class impl names
-----------------------------------------------------------------
Key: FORGE-2181
URL:
https://issues.jboss.org/browse/FORGE-2181
Project: Forge
Issue Type: Task
Affects Versions: 2.12.3.Final
Reporter: Claus Ibsen
Attachments: forge.log
I want to use the MavenPluginFacet from my own command, and have defined
{code}
@FacetConstraint({MavenPluginFacet.class})
public class CamelSetupCommand extends AbstractCamelProjectCommand {
...
MavenPluginFacet pluginFacet = project.getFacet(MavenPluginFacet.class);
MavenPluginBuilder plugin = MavenPluginBuilder.create()
.setCoordinate(createCamelCoordinate("camel-maven-plugin",
version.getValue()));
pluginFacet.addPlugin(plugin);
{code}
But my command is not registered and I could find this from the forge log
{code}
14:22:21,847 INFO [org.jboss.weld.Bootstrap] (io.fabric8.forge:camel,2.2-SNAPSHOT)
WELD-000119: Not generating any bean definitions from
io.fabric8.forge.camel.commands.project.CamelSetupCommand because of underlying class
loading error: Type [unknown] not found. If this is unexpected, enable DEBUG logging to
see the full error.
{code}
I suspect its because of the annotation constraint
{code}
@FacetConstraint({MavenPluginFacet.class})
{code}
which can't find the type, and thus fails.
I noticed this command can list the facets, and it lists
{code}
[mydemo]$ project-list-facets
ConfigurationFacetImpl [org.jboss.forge.addon.configuration.ConfigurationFacetImpl@38bc685a]
MavenJavaCompilerFacet [org.jboss.forge.addon.maven.projects.facets.MavenJavaCompilerFacet@38bc685a]
MavenJavaSourceFacet [org.jboss.forge.addon.maven.projects.facets.MavenJavaSourceFacet@38bc685a]
MavenResourcesFacet [org.jboss.forge.addon.maven.projects.facets.MavenResourcesFacet@38bc685a]
MavenWebResourcesFacet [org.jboss.forge.addon.maven.projects.facets.MavenWebResourcesFacet@38bc685a]
MavenDependencyFacet [org.jboss.forge.addon.maven.projects.facets.MavenDependencyFacet@38bc685a]
MavenPackagingFacet [org.jboss.forge.addon.maven.projects.facets.MavenPackagingFacet@38bc685a]
MavenMetadataFacet [org.jboss.forge.addon.maven.projects.facets.MavenMetadataFacet@38bc685a]
MavenPluginFacetImpl [org.jboss.forge.addon.maven.projects.MavenPluginFacetImpl@38bc685a]
MavenFacetImpl [org.jboss.forge.addon.maven.projects.MavenFacetImpl@38bc685a]
{code}
Notice that some of them are using the interface type name, and others are using the
class impl class type. I wonder if it should not always use the interface so as a I client
I only need to -api dependency.