Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-686

JavaSourceFacet eventualls returns an invalid base package

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.1.2.Final
    • 1.0.5.Final
    • Resources
    • None
    • Hide

      1.) EXEC: create a new project:

      new-project --named infinispan-forge-test
      

      2.) EXEC: in your code now do

      DirectoryResource basePackage = project.getFacet(JavaSourceFacet.class).getBasePackageResource();
      

      3.) ASSERT: what you get back is a resource at <project source dir>/infinispan-forge-test which is not valid.
      4.) EXEC: feed that to the prompt:

      prompt.promptCommon(target package: ", PromptType.JAVA_PACKAGE, basePackage.toString())
      

      Result:
      The prompt will not validate your value and tell you

      Default value [infinispan-forge-test] is not a valid match for the given prompt type [JAVA_PACKAGE]

      IMHO javaSourceFacet should return a valid base package. If using the group-id does not provide a valid package, it should mangle it to become valid or return an empty base package

      Show
      1.) EXEC: create a new project: new -project --named infinispan-forge-test 2.) EXEC: in your code now do DirectoryResource basePackage = project.getFacet(JavaSourceFacet.class).getBasePackageResource(); 3.) ASSERT: what you get back is a resource at <project source dir>/infinispan-forge-test which is not valid. 4.) EXEC: feed that to the prompt: prompt.promptCommon(target package : ", PromptType.JAVA_PACKAGE, basePackage.toString()) Result: The prompt will not validate your value and tell you Default value [infinispan-forge-test] is not a valid match for the given prompt type [JAVA_PACKAGE] IMHO javaSourceFacet should return a valid base package. If using the group-id does not provide a valid package, it should mangle it to become valid or return an empty base package

    Attachments

      Issue Links

        Activity

          People

            rhn-support-ggastald George Gastaldi
            adietish@redhat.com André Dietisheim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: