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

Scaffold source generation fails if project groupId not a valid package name

XMLWordPrintable

    • Hide

      new-project regress-pkg
      scaffold setup
      entity setup
      entity --named at.tfr.regress.model.Parent
      entity --named Parent --package at.tfr.regress.model
      field string --named name
      entity --named Child --package at.tfr.regress.model
      field string --named name
      field manyToOne --named parent --fieldType at.tfr.regress.model.Parent.java --inverseFieldName children
      scaffold from-entity at.tfr.regress.model.* --overwrite

      Show
      new-project regress-pkg scaffold setup entity setup entity --named at.tfr.regress.model.Parent entity --named Parent --package at.tfr.regress.model field string --named name entity --named Child --package at.tfr.regress.model field string --named name field manyToOne --named parent --fieldType at.tfr.regress.model.Parent.java --inverseFieldName children scaffold from-entity at.tfr.regress.model.* --overwrite
    • Low

      MavenJavaSourceFacet too optimistic about naming of the artifact groupId.
      The automatically generated package name is syntactically unchecked:

      @Override
      public String getBasePackage()

      { return project.getFacet(MavenCoreFacet.class).getMavenProject().getGroupId(); }

      .
      .
      [regress-pkg] regress-pkg $ scaffold from-entity at.tfr.regress.model.*
      **INFO** Using currently installed scaffold [faces]
      **ERROR** [scaffold from-entity] Error generating default scaffolding: null

      ???

      [regress-pkg] regress-pkg $ set VERBOSE true
      [regress-pkg] regress-pkg $ scaffold from-entity at.tfr.regress.model.*
      **INFO** Using currently installed scaffold [faces]
      **ERROR** [scaffold from-entity] Error generating default scaffolding: null
      org.jboss.forge.shell.exceptions.CommandExecutionException: Error generating default scaffolding: null
      at org.jboss.forge.shell.command.Execution.perform(Execution.java:154)
      at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:125)
      at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:63)
      <SNIP>
      at java.lang.Thread.run(Thread.java:722)
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.jboss.forge.shell.command.Execution.perform(Execution.java:150)
      ... 31 more
      Caused by: java.lang.RuntimeException: Error generating default scaffolding: null
      at org.jboss.forge.scaffold.faces.FacesScaffold.generateFromEntity(FacesScaffold.java:341)
      at org.jboss.forge.scaffold.plugins.ScaffoldPlugin.generateFromEntity(ScaffoldPlugin.java:187)
      ... 36 more
      Caused by: java.lang.IllegalArgumentException
      at org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java:190)
      at org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:1269)
      at org.eclipse.jdt.core.dom.AST.newName(AST.java:1389)
      at org.jboss.forge.parser.java.impl.AbstractJavaSource.setPackage(AbstractJavaSource.java:491)
      at org.jboss.forge.parser.java.impl.AbstractJavaSource.setPackage(AbstractJavaSource.java:65)
      at org.jboss.forge.scaffold.faces.FacesScaffold.generateFromEntity(FacesScaffold.java:275)

              Unassigned Unassigned
              fruehbeck@aon.at Thomas Frühbeck (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: