Isis
  1. Isis
  2. ISIS-82

@MaxLength and other validators don't work in the archetype-generated project

    Details

    • Type: Question Question
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 0.1.2-incubating
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows 7, Maven 2, Eclipse 3.6.1

      Description

      Generate project as below. Import into Eclipse. Annotate ToDoItem.getDescription with @MaxLength(10). Run DnD viewer. Observe that the Description ignores the MaxLength validation. Same problem with validateDescription method. Same problem with HTML viewer.

      Unless I'm doing something wrong, this is a bug.

      $ mvn -U archetype:generate -D archetypeCatalog=http://incubator.apache.org/isis -D archetypeGroupId=org.apache.isis.support -D archetypeArtifactId=quickstart-archetype
      [INFO] Scanning for projects...
      [INFO] Searching repository for plugin with prefix: 'archetype'.
      [INFO] org.apache.maven.plugins: checking for updates from central
      [INFO] org.codehaus.mojo: checking for updates from central
      [INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for updates from central
      [INFO] ------------------------------------------------------------------------
      [INFO] Building Maven Default Project
      [INFO] task-segment: [archetype:generate] (aggregator-style)
      [INFO] ------------------------------------------------------------------------
      [INFO] Preparing archetype:generate
      [INFO] No goals needed for project - skipping
      [INFO] [archetype:generate

      {execution: default-cli}

      ]
      [INFO] Generating project in Interactive mode
      [INFO] Archetype [org.apache.isis.support:quickstart-archetype:0.1.0-incubating-SNAPSHOT -> https://repository.apache.org/content/groups/snapshots-group/] found in catalog http://incubator.apache.org/isis
      [INFO] snapshot org.apache.isis.support:quickstart-archetype:0.1.0-incubating-SNAPSHOT: checking for updates from quickstart-archetype-repo
      Define value for property 'groupId': : com.mycompany.mygroup
      Define value for property 'artifactId': : myapp
      Define value for property 'version': 1.0-SNAPSHOT:
      Define value for property 'package': com.mycompany.mygroup:
      Confirm properties configuration:
      groupId: com.mycompany.mygroup
      artifactId: myapp
      version: 1.0-SNAPSHOT
      package: com.mycompany.mygroup
      Y: y
      [INFO] Parent element not overwritten in D:\x\myapp\dom\pom.xml
      [INFO] Parent element not overwritten in D:\x\myapp\fixture\pom.xml
      [INFO] Parent element not overwritten in D:\x\myapp\objstore-default\pom.xml
      [INFO] Parent element not overwritten in D:\x\myapp\quickrun\pom.xml
      [INFO] Parent element not overwritten in D:\x\myapp\viewer-html\pom.xml
      [INFO] Parent element not overwritten in D:\x\myapp\viewer-wicket\pom.xml
      [INFO] Parent element not overwritten in D:\x\myapp\viewer-restful\pom.xml
      [INFO] Parent element not overwritten in D:\x\myapp\viewer-scimpi\pom.xml
      [INFO] Parent element not overwritten in D:\x\myapp\tests-junit\pom.xml
      [INFO] Parent element not overwritten in D:\x\myapp\tests-bdd\pom.xml
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 25 seconds
      [INFO] Finished at: Thu Mar 17 00:14:39 EST 2011
      [INFO] Final Memory: 16M/175M
      [INFO] ------------------------------------------------------------------------

        Activity

        Jeff Schultz created issue -
        Dan Haywood made changes -
        Field Original Value New Value
        Assignee Dan Haywood [ danhaywood ]
        Hide
        Dan Haywood added a comment -

        Sorry, I still can't reproduce this.

        I've also taken the .tar.gz that you sent me privately, imported into a clean workspace, and it runs fine (at least using the .launch files in the quickrun project). Not exactly sure what to do next

        Can anyone else on isis-dev reproduce the problem?

        Show
        Dan Haywood added a comment - Sorry, I still can't reproduce this. I've also taken the .tar.gz that you sent me privately, imported into a clean workspace, and it runs fine (at least using the .launch files in the quickrun project). Not exactly sure what to do next Can anyone else on isis-dev reproduce the problem?
        Hide
        Jeff Schultz added a comment -

        Thanks Dan. Frustrating.

        I assume it's a configuration issue with my Eclipse or Maven installation.

        I can see the MaxLengthFacetAnnotationForProperty constructed during initialisation, but it isn't called when ToDoItems are created at runtime. Tracing through the Facets actually used, it looks like only the default MaxLengthFacetUnlimited is used.

        Show
        Jeff Schultz added a comment - Thanks Dan. Frustrating. I assume it's a configuration issue with my Eclipse or Maven installation. I can see the MaxLengthFacetAnnotationForProperty constructed during initialisation, but it isn't called when ToDoItems are created at runtime. Tracing through the Facets actually used, it looks like only the default MaxLengthFacetUnlimited is used.
        Dan Haywood made changes -
        Affects Version/s 0.1.0-incubating-SNAPSHOT [ 12316299 ]
        Affects Version/s 0.1.1-incubating [ 12315421 ]
        Component/s Support: Archetype: Quickstart [ 12313821 ]
        Component/s Domain: Entities [ 12313816 ]
        Dan Haywood made changes -
        Fix Version/s 0.2.0-incubating [ 12315988 ]
        Dan Haywood made changes -
        Fix Version/s 0.3.0-incubating [ 12315989 ]
        Fix Version/s 0.2.0-incubating [ 12315988 ]
        Dan Haywood made changes -
        Affects Version/s 0.1.1-incubating-SNAPSHOT [ 12316298 ]
        Affects Version/s 0.1.0-incubating-SNAPSHOT [ 12316299 ]
        Dan Haywood made changes -
        Affects Version/s 0.1.2-incubating [ 12315421 ]
        Affects Version/s 0.1.1-incubating-SNAPSHOT [ 12316298 ]
        Dan Haywood made changes -
        Fix Version/s isis-1.0.0 [ 12315989 ]
        Dan Haywood made changes -
        Fix Version/s quickstart-wrj-archetype-1.0.2 [ 12323918 ]
        Dan Haywood made changes -
        Fix Version/s archetype-wrj-1.0.2 [ 12323918 ]
        Dan Haywood made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Cannot Reproduce [ 5 ]
        Dan Haywood made changes -
        Component/s Archetype: ToDoApp WRJ [ 12313821 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        1094d 3h 56m 1 Dan Haywood 14/Mar/14 17:50

          People

          • Assignee:
            Dan Haywood
            Reporter:
            Jeff Schultz
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development