I am trying to migrate a project from Ant to Maven.
The framework we are using is Struts. For the front end, have used Tiles, JSPs, Javascript, CSS. Database is queried using SQL files.
The project has 3 parts - of which I have managed to migrate the first part. It wasnt too complex. We arent using JUnits, so I am not concerned with test classes and test resources.
I am confused about the second part.
The default directory structure of Maven is:
project home - which contains pom.xml
src\main\java - which contains the Java sourcecode
src\main\resources - which contains property files
What I am confused about is - where do I put the Tiles, JSPs, Javascript, CSS, and SQL files???
If I make a separate folder for them, how do I include that in the pom.xml file?
Another option I just thought of - would be to stuck to the existing directory structure of the project, and just make changes in pom.xml. But I dont think this is recommended since the Java code, SQL code, Tiles etc are in different places and in pom.xml, only the java and resources location can be specified.
WARs are produced by the WAR plugin, and it has some particular directory structure needs that augment those for a generic Maven project. Most notably, everything in src/main/webapp will be used as boilerplate (copied verbatim) into the target WAR. I don't think the WAR plugin uses src/main/resources.
I have never built a Struts app with Maven, since by the time I finally made my peace with Maven, I'd already migrated to JSF. However, if you search the documentation for Maven plugins, I would not be surprised if you found one for Struts. You will definitely find documentation for the WAR plugin.
Just be careful. Web searches often bring up results for Maven 1 plugins and things changed a lot for Maven 2.
Customer surveys are for companies who didn't pay proper attention to begin with.
Oh, are archetypes considered plugins? I guess I would have said an archetype uses the archetype plugin, but isn't one.
(Of course, I would have also thought that there'd have been a separate XDoclet plugin and you'd just use it during a Struts 1 build, which shows how much I know.)
David Newton wrote:Oh, are archetypes considered plugins? I guess I would have said an archetype uses the archetype plugin, but isn't one.
(Of course, I would have also thought that there'd have been a separate XDoclet plugin and you'd just use it during a Struts 1 build, which shows how much I know.)
Actually, I think technically, they are, but that's purely incidental. What they indicated to me was that they were capable of setting up projects with Struts plugins.
Although a generic XDoclet plugin would be reasonable, Maven tends towards a more high-level approach, so a Struts plugin would be most likely to pull in an XDoclet plugin as one of its dependencies, then apply it in a way that made sense for Struts.