[forge-dev] Required Parameter is ignored although it is set

Alex Soto Bueno asotobue at redhat.com
Wed Jan 25 10:40:45 EST 2017


Hello,

I  have next command:

public class AddAlgeronFolderPublisher extends AbstractProjectCommand
implements UICommand
{

   @Inject
   private ProjectFactory projectFactory;

   @Inject
   private FacetFactory facetFactory;

   @Inject
   @WithAttributes(shortName = 'o', label = "Output Folder", required =
true)
   private UISelectOne<String> outputFolder;

   @Inject
   @WithAttributes(shortName = 'c', label = "Contracts Folder")
   private UISelectOne<String> contractFolder;

   @Override
   public UICommandMetadata getMetadata(UIContext context)
   {
      return Metadata.from(super.getMetadata(context), getClass())
              .category(Categories.create("Algeron"))
              .name("Arquillian Algeron: Add Folder Publisher")
              .description("This command registers a Folder Publisher for
Algeron");
   }

   @Override
   public void initializeUI(UIBuilder builder) throws Exception
   {
      builder.add(outputFolder).add(contractFolder);
      contractFolder.setDefaultValue("target/pacts");
   }

// ......
}

When in Forge console I run:

arquillian-algeron-add-folder-publisher --output-folder /tmp

I got:

***INFO*** Required inputs not satisfied, entering interactive mode
***ERROR*** Output Folder must be specified.

But you can see that I am setting the attribute in the command so any idea
of why this is failing?


More information about the forge-dev mailing list