Hi,

when creating a fresh Wicket project with the following line as
generated by the quickstart page on wicket.apache.org:

mvn archetype:create -DarchetypeGroupId=org.apache.wicket
-DarchetypeArtifactId=wicket-archetype-quickstart
-DarchetypeVersion=1.4-rc4 -DgroupId=com.mycompany
-DartifactId=myproject

...I run into a number of (easily fixable, but somewhat annoying and
non-obvious) problems.

- The classpath file generated by 'mvn eclipse:eclipse' has an
  include-pattern of '**/*.java' for both src/test/java and
  src/main/java. This means that by default none of the HTML files or
  other resources will be copied to the classpath when for example
  using the 'Start' class.
   This can of course be fixed by manually removing these restrictions
  from the classpath, but on regenerating with eclipse:eclipse they
  will be added again. Also, this is probably non-obvious to new users.
  I think this is more of a Maven problem than one with Wicket, but it
  shows up as more of a problem here because not many other projects
  have their resources directly in the packages. I have not found an
  option in eclipse:eclipse to set these include patterns. Does anybody
  know whether any such options exist? If yes, I propose adding an
  appropriate setting to the Wicket archetype. If not, I think there
  should be a notice about this quirk on the quickstart page.
   I realize this is probably due to the fact that Maven wants to copy
  the resources itself, so it can do its filtering. However, I don't
  really see that as an issue for a typical Wicket project, or am I
  missing something?

The second problem is due to the way I set up my project -- it may be
odd (is it?), but I think this is rather sensible for standalone
component development.

- I am developing a standalone component for use in other projects, so
  under src/main/ I'd like to have only the classes and resources that
  belong to the component. On the other hand, for testing and debugging
  purposes, a simple Wicket application and page are very handy, so I
  moved those from src/main to src/test, since these shouldn't show up
  in the generated jar file.
   This works in Eclipse when I remove the restrictions mentioned above
  from both src/main and src/test. When I try to use 'mvn jetty:run',
  it breaks down, complaining that it can't find the Application class
  (and by extension also the other classes in src/test). This is
  fixable by adding
    <configuration>
     <useTestClasspath>true</useTestClasspath>
    </configuration>
  to the jetty-plugin part of the generated pom.xml. I don't see any
  negative side-effects of this, so I'd like to propose adding this to
  the archetype.

As an aside: Is this practice of keeping a debug Application under
src/test considered good or bad practice? If bad, why?

Best regards, and thanks for a great framework!
Carl-Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to