[ https://issues.apache.org/jira/browse/JSPWIKI-651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13533411#comment-13533411 ]
Glen Mazza commented on JSPWIKI-651: ------------------------------------ The attached Maven pom can be placed in the JSPWiki home directory and the standard Maven commands "mvn clean", "mvn compile", and "mvn test-compile" (each one incorporating what the preceding command does) are now available. However, about 2/3rds of the test cases (called either via "mvn test" and "mvn package" which includes mvn test) are presently failing with this setup (632 out of 964 are failing). I had it down to just about 100 failures (mainly the web tests) yesterday but the latest API commits for some reason on my machine are causing JSPWiki to be unable to create org.apache.wiki.api.PluginManager (as done in WikiEngine, line 533)--despite heavy debugging I don't know what the problem is yet (the Ant tests still work though.) -- probably a classpath issue. Also, by using mvn dependency:tree I was able to see which dependencies are transitive (brought in automatically by Maven without need for explicit declaration) and hence was able to remove about five dependencies in Maven pom.xml compared to what we need to have in the Ant file: [INFO] ------------------------------------------------------------------------ [INFO] Building Apache JSPWiki (Incubating) 2.9.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ jspwiki --- [INFO] org.apache.incubator:jspwiki:war:2.9.1-SNAPSHOT [INFO] +- xmlrpc:xmlrpc:jar:2.0.1:compile [INFO] +- org.apache.lucene:lucene-highlighter:jar:3.6.0:compile [INFO] | +- org.apache.lucene:lucene-core:jar:3.6.0:compile [INFO] | +- org.apache.lucene:lucene-memory:jar:3.6.0:compile [INFO] | \- org.apache.lucene:lucene-queries:jar:3.6.0:compile [INFO] | \- jakarta-regexp:jakarta-regexp:jar:1.4:compile [INFO] +- javax.servlet:servlet-api:jar:2.4:compile [INFO] +- net.sourceforge:sandler:jar:0.5:compile [INFO] | \- xpp3:xpp3:jar:1.1.3.4-RC3:compile [INFO] +- opensymphony:oscache:jar:2.3:compile [INFO] +- oro:oro:jar:2.0.7:compile [INFO] +- javax.mail:mail:jar:1.4:compile [INFO] | \- javax.activation:activation:jar:1.1:compile [INFO] +- log4j:log4j:jar:1.2.14:compile [INFO] +- javax.servlet.jsp:jsp-api:jar:2.0:compile [INFO] +- com.metaparadigm:json-rpc:jar:1.0:compile [INFO] +- org.jvnet.hudson:org.suigeneris.jrcs.diff:jar:0.4.2:compile [INFO] +- jdom:jdom:jar:1.0:compile [INFO] +- javax.servlet:jstl:jar:1.1.2:compile [INFO] +- org.freshcookies:freshcookies-security:jar:0.60:compile [INFO] +- ecs:ecs:jar:1.4.2:compile [INFO] +- commons-lang:commons-lang:jar:2.6:compile [INFO] +- commons-fileupload:commons-fileupload:jar:1.2.1:compile [INFO] +- net.sourceforge:akismet-java:jar:1.02:compile [INFO] | +- commons-codec:commons-codec:jar:1.3:compile [INFO] | \- commons-logging:commons-logging:jar:1.0.4:compile [INFO] +- net.sourceforge.stripes:stripes:jar:1.5.7:compile [INFO] +- commons-httpclient:commons-httpclient:jar:3.1:compile [INFO] +- org.hsqldb:hsqldb:jar:1.8.0.10:test [INFO] +- tomcat:jasper-runtime:jar:5.5.23:test [INFO] | \- commons-el:commons-el:jar:1.0:test [INFO] +- org.eclipse.jetty.aggregate:jetty-all:jar:7.6.7.v20120910:test [INFO] | \- org.eclipse.jetty.orbit:javax.servlet:jar:2.5.0.v201103041518:test [INFO] +- junit:junit:jar:3.8.2:test [INFO] +- org.seleniumhq.selenium:selenium-java:jar:2.25.0:test [INFO] | +- org.seleniumhq.selenium:selenium-android-driver:jar:2.25.0:test [INFO] | | \- org.seleniumhq.selenium:selenium-remote-driver:jar:2.25.0:test [INFO] | | +- cglib:cglib-nodep:jar:2.1_3:test [INFO] | | +- org.json:json:jar:20080701:test [INFO] | | \- com.google.guava:guava:jar:12.0:test [INFO] | | \- com.google.code.findbugs:jsr305:jar:1.3.9:test [INFO] | +- org.seleniumhq.selenium:selenium-chrome-driver:jar:2.25.0:test [INFO] | +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.25.0:test [INFO] | | +- org.seleniumhq.selenium:selenium-api:jar:2.25.0:test [INFO] | | +- net.sourceforge.htmlunit:htmlunit:jar:2.9:test [INFO] | | | +- commons-collections:commons-collections:jar:3.2.1:test [INFO] | | | +- org.apache.httpcomponents:httpmime:jar:4.1.2:test [INFO] | | | +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.9:test [INFO] | | | +- net.sourceforge.nekohtml:nekohtml:jar:1.9.15:test [INFO] | | | \- net.sourceforge.cssparser:cssparser:jar:0.9.5:test [INFO] | | | \- org.w3c.css:sac:jar:1.3:test [INFO] | | \- org.apache.httpcomponents:httpclient:jar:4.1.2:test [INFO] | | \- org.apache.httpcomponents:httpcore:jar:4.1.2:test [INFO] | +- org.seleniumhq.selenium:selenium-firefox-driver:jar:2.25.0:test [INFO] | | +- commons-io:commons-io:jar:2.0.1:test [INFO] | | \- org.apache.commons:commons-exec:jar:1.1:test [INFO] | +- org.seleniumhq.selenium:selenium-ie-driver:jar:2.25.0:test [INFO] | | +- net.java.dev.jna:jna:jar:3.4.0:test [INFO] | | \- net.java.dev.jna:platform:jar:3.4.0:test [INFO] | +- org.seleniumhq.selenium:selenium-iphone-driver:jar:2.25.0:test [INFO] | +- org.seleniumhq.selenium:selenium-safari-driver:jar:2.25.0:test [INFO] | +- org.seleniumhq.selenium:selenium-support:jar:2.25.0:test [INFO] | \- org.webbitserver:webbit:jar:0.4.6:test [INFO] | \- org.jboss.netty:netty:jar:3.2.7.Final:test [INFO] \- jaxen:jaxen:jar:1.1-beta-6:test [INFO] +- dom4j:dom4j:jar:1.5.2:test [INFO] | \- jaxme:jaxme-api:jar:0.3:test [INFO] +- xerces:xmlParserAPIs:jar:2.6.2:test [INFO] +- xerces:xercesImpl:jar:2.6.2:test [INFO] \- xom:xom:jar:1.0b3:test [INFO] +- com.ibm.icu:icu4j:jar:2.6.1:test [INFO] +- xalan:xalan:jar:2.6.0:test [INFO] | \- xml-apis:xml-apis:jar:1.0.b2:test [INFO] \- org.ccil.cowan.tagsoup:tagsoup:jar:0.9.7:test [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ I also went through each of the dependencies, commenting them out and building to determine if any can be removed from our build.xml file (I didn't test such a compiled WAR, just did compilation) -- the following Maven is reporting as unnecessary or miscategorized in our build.xml: Miscategorized: <dependency><groupId>net.sourceforge.stripes</groupId><artifactId>stripes</artifactId><version>1.5.7</version></dependency> is listed as a "test" dependency in our build.xml but is actually a main dependency (used by regular source code). Not needed: (at least for compilation and running of tests; would need to confirm with a WAR deployment): <!--dependency><groupId>commons-io</groupId><artifactId>commons-io</artifactId><version>1.4</version></dependency--> <!--dependency><groupId>taglibs</groupId><artifactId>standard</artifactId><version>1.1.2</version></dependency--> <!--dependency><groupId>jstl</groupId><artifactId>jstl</artifactId><version>1.1.2</version></dependency--> <!--dependency><groupId>nekohtml</groupId><artifactId>nekohtml</artifactId><version>0.9.4</version></dependency--> <!--dependency><groupId>org.dojotoolkit</groupId><artifactId>custom_rhino</artifactId><version>0.4.3</version><scope>test</scope></dependency--> <!--dependency><groupId>tomcat</groupId><artifactId>jasper-compiler</artifactId><version>5.5.23</version><scope>test</scope></dependency--> <!--dependency><groupId>xerces</groupId><artifactId>xercesImpl</artifactId><version>2.6.2</version><scope>test</scope></dependency--> <!--dependency><groupId>xml-apis</groupId><artifactId>xml-apis</artifactId><version>1.0.b2</version><scope>test</scope></dependency--> <!--dependency><groupId>com.yahoo.platform.yui</groupId><artifactId>yuicompressor</artifactId><version>2.4.7</version><scope>test</scope></dependency--> If it is known already if any of these dependencies aren't being used it would be good to remove them from the Ant build.xml file. Possible next steps (if we wish to continue here): 1.) Making the source more amenable to Mavenization: using the Standard Directory Layout (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html) (e.g., the source classes to src/main/java, webapp stuff in src/main/webapp, resources in src/main/resources; test classes to src/test/java, test resources in src/test/resources) -- although it's simple in the pom to declare non-standard locations (already included). Also, do less configuration of our property files (jspwiki.properties) in the build.xml for our test cases, instead have an already created jspwiki.properties configured w/necessary test values that can be called by either Ant or Maven as-is. 2.) Get the non-Web Test cases working (it's really mostly just that single PluginManager issue mentioned above that popped up above, that will fix about 80% of the failures). 3.) Configure the commented-out Maven war plugin to create a WAR file that will work on Tomcat (not hard to do if the test cases are working, I can probably work on this). Having a WAR facilitates the web tests. 4.) Separate the unit tests from the integration tests (add the -IT prefix to the latter, see the 2nd paragraph here: http://www.jroller.com/gmazza/entry/jersey_samples_on_cxf#jc2). The integration tests are the web tests that rely on an already created WAR. At this stage, all tests should be passing. 5.) Incorporate the Rat reporting and Cobertura stuff (CXF's pom can be copied from here: http://svn.apache.org/viewvc/cxf/trunk/pom.xml?view=co&content-type=text%2Fplain). Anyway, we have a first step at least... > 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