Hi Glen,
I'm neither a committer on this project so my "vote" should
be taken with some salt, but in my own experience with both
maven and ant, I've gone back to preferring ant, with the
changes you're suggesting, i.e., adopting a directory
structure that people are familiar with, but sticking with
ant. The commitment to maven is sort of like the commitment
to GPL: it forces you to alter your project. If one desires
the maven approach for a project (and it's warranted for
that project), then great, but when I buy a hammer I don't
want to have to alter how I build a house; I just want a
new hammer. Ant is just a normal hammer. I leave it up to
others to decide if maven is appropriate to JSPWiki.
One thing I have started doing is having ant manage the
dependency acquisition, which supports explicit pulls of
specifically-versioned libraries (so I control what gets
pulled, not simply the latest). This could of course be
done with Ivy, but having it within ant works fine for
me, just one less tool.
To be of some help in this regard, I've attached a
skeleton build-deps.xml file that includes the basic ant
dependency checker and downloader. This could be filled
out with all of the jars that would be included with
JSPWiki. I like this approach since it means I don't have
to include a much smaller number of libraries with my own
distros.
Ichiro
On Mon, Dec 17, 2012 at 9:58 AM, Glen Mazza (JIRA) <[email protected]> wrote:
>
> [
> https://issues.apache.org/jira/browse/JSPWIKI-651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13533513#comment-13533513
> ]
>
> Glen Mazza commented on JSPWIKI-651:
> ------------------------------------
>
> Yes, for code modularization, an excellent first step is to forget about
> Maven but still use the Maven standard directory format
> (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html)
> and then update the Ant build.xml to work with that new structure. At least
> with src/main/java, test/man/java, src/main/resources, test/main/resources
> (and for anything under the WEB-INF folder, src/main/webapp). This will make
> JSPWiki look like just about every other Mavenized project, making it easier
> for new people to jump in, knowing where everything is and realizing they can
> use the same Maven commands they use on other projects without needing to
> study a big build.xml file anymore.
>
> As for all those submodules, sure, sounds good! But you might wish to keep
> it simple right now with one pom.xml until we're off Ant (because others have
> to be brought up to speed with Maven), then put in submodules after that. Or
> do a hybrid... You understand the JWPWiki code a lot more than I do so you
> might be more comfortable jumping to submodules more quickly than I. The
> Apache CXF pom.xml has about as many bells and whistles as you can find, but
> you might want to take a look at the Apache Roller pom.xml & folder structure
> (http://svn.apache.org/viewvc/roller/trunk/), as it is also a Java web app
> like JSPWiki and was created by several skilled developers.
>
>> Convert JSPWiki to a Maven project
>> ----------------------------------
>>
>> Key: JSPWIKI-651
>> URL: https://issues.apache.org/jira/browse/JSPWIKI-651
>> Project: JSPWiki
>> Issue Type: Improvement
>> Reporter: Daniel Johansson
>> Priority: Trivial
>> Labels: ant, build, ivy, maven
>> Attachments: pom.xml
>>
>>
>> Hello there, I was hoping to maybe one day contribute to the JSPWiki project
>> and after having checked out the trunk code and played around somewhat I was
>> thinking it would be very nice if this project used Maven.
>> I'm sure most of you are familiar with Maven in one way or another, you
>> might even have a really good reason for not doing this to JSPWiki.
>
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA administrators
> For more information on JIRA, see: http://www.atlassian.com/software/jira
<?xml version="1.0"?>
<project name="x5" basedir="." default="usage">
<property name="repo.url"
value="http://repo.maven.apache.org/maven2" />
<property name="repo1.url"
value="http://repo1.maven.org/maven2" />
<property name="repository.url"
value="https://repository.apache.org/content/repositories/releases/" />
<!-- ... -->
<!-- Command : ant prepare
Creates any supporting directories
-->
<target name="prepare"
description="creates any supporting directories"
depends="init">
<mkdir dir="${build.home}"/>
<!-- ... -->
<antcall target="__download-deps"/>
</target>
<target name="__dep.check">
<condition property="deps.exists">
<!-- trigger is a jar file not normally included in distribution -->
<available file="${lib.home}/commons-logging-1.1.1.jar" type="file"/>
</condition>
</target>
<target name="__download-deps"
depends="__dep.check"
unless="deps.exists">
<echo>downloading dependencies</echo>
<download-deps />
</target>
<!-- download dependencies .............................................. -->
<target name="test-file-exists">
<echo message="Testing for ${download-to-file}" level="debug"/>
<available file="${download-to-file}" property="exists" />
</target>
<target name="download-lib" unless="exists" depends="test-file-exists">
<echo message="downloading from repository: ${repo.url}..."/>
<get src="${download-url}" dest="${download-to-file}" />
</target>
<macrodef name="get-element">
<attribute name="to-file" />
<attribute name="url" />
<sequential>
<antcall target="download-lib">
<param name="download-to-file" value="@{to-file}"/>
<param name="download-url" value="@{url}" />
</antcall>
</sequential>
</macrodef>
<macrodef name="download-deps">
<sequential>
<get-element to-file="${lib.home}/commons-logging-1.1.1.jar"
url="${repo.url}/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" />
<get-element to-file="${lib.home}/junit-4.11.jar"
url="${repo.url}/junit/junit/4.11/junit-4.11.jar" />
<get-element to-file="${lib.home}/hamcrest-core-1.3.jar"
url="${repo.url}/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar" /><!-- required with JUnit -->
<get-element to-file="${lib.home}/log4j-1.2.17.jar"
url="${repo.url}/log4j/log4j/1.2.17/log4j-1.2.17.jar" />
<!-- ... -->
</sequential>
</macrodef>
<!-- Command : ant cleanlibs
Removes all dependency libraries. This doesn't
simply remove *all* libraries, since some are
included with the distribution.
-->
<target name="cleanlibs"
description="clean dependency libraries">
<echo message="cleaning dependencies…"/>
<delete>
<fileset dir="${lib.home}">
<include name="commons-logging-1.1.1.jar" />
<include name="junit-4.11.jar" />
<include name="hamcrest-core-1.3.jar" />
<include name="log4j-1.2.17.jar" />
<!-- ... -->
</fileset>
</delete>
</target>
<!-- ... -->
</project>