GeoServer
  1. GeoServer
  2. GEOS-4652

Support building GeoServer with Maven 3

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.x
    • Fix Version/s: 2.2-beta1
    • Component/s: Global
    • Labels:
      None
    • Number of attachments :
      2

      Description

      Add support for building GeoServer with Maven 3.

      Build currently fails in maven/config with:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:2.7:descriptor (default-descriptor) on project config: The API of the mojo scanner is not compatible with this plugin version. Please check the plugin dependencies configured in the POM and ensure the versions match. org.apache.maven.tools.plugin.scanner.MojoScanner.populatePluginDescriptor(Lorg/apache/maven/tools/plugin/PluginToolsRequest;)V -> [Help 1]
      
      1. GEOS-4652.complete.patch
        5 kB
        Ben Caradoc-Davies
      2. GEOS-4652.patch
        3 kB
        Justin Deoliveira

        Issue Links

          Activity

          Hide
          Ben Caradoc-Davies added a comment -

          -------- Original Message --------
          Subject: Re: [Geoserver-devel] [ExternalEmail] Re: [Geotools-devel] Proposal to update to Maven 3
          Date: Thu, 30 Jun 2011 10:21:50 +0800
          From: Ben Caradoc-Davies
          To: Justin Deoliveira
          CC: geoserver-devel@lists.sourceforge.net, Andrea Aime

          Justin,

          with your patch, maven 3 build has a unit test failure in ows:
          testHandleServiceExceptionCauses(org.geoserver.ows.DefaultServiceExceptionHandlerTest)

          -------------------------------------------------------------------------------
          Test set: org.geoserver.ows.DefaultServiceExceptionHandlerTest
          -------------------------------------------------------------------------------
          Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.274
          sec <<< FAILURE!
          testHandleServiceExceptionCauses(org.geoserver.ows.DefaultServiceExceptionHandlerTest)
          Time elapsed: 0.223 sec <<< FAILURE!
          junit.framework.AssertionFailedError
          at junit.framework.Assert.fail(Assert.java:47)
          at junit.framework.Assert.assertTrue(Assert.java:20)
          at junit.framework.Assert.assertTrue(Assert.java:27)
          at
          org.geoserver.ows.DefaultServiceExceptionHandlerTest.testHandleServiceExceptionCauses(DefaultServiceExceptionHandlerTest.java:102)

          Kind regards,
          Ben.

          On 29/06/11 13:20, Justin Deoliveira wrote:
          > Yeah, the geoserver build uses a custom plugin to copy over a data directory into the webapp. Its pretty outdated as it seems. A full blown plug-in is not really need for that, and actually it just complicates the build. Some inline ant with the antrun plugin in the web/app pom should do the same and be easier to maintain. So I attached a patch to GEOS-4652 that does just that.
          >
          > With that and a few other minor tweaks I was able to build geoserver with maven 3. However I did not not run with tests, getting late here So if the other devs could give the patch a spin that would be great. Regardless it should be a decent starting point.
          >
          > -Justin
          >
          >

          Show
          Ben Caradoc-Davies added a comment - -------- Original Message -------- Subject: Re: [Geoserver-devel] [ExternalEmail] Re: [Geotools-devel] Proposal to update to Maven 3 Date: Thu, 30 Jun 2011 10:21:50 +0800 From: Ben Caradoc-Davies To: Justin Deoliveira CC: geoserver-devel@lists.sourceforge.net, Andrea Aime Justin, with your patch, maven 3 build has a unit test failure in ows: testHandleServiceExceptionCauses(org.geoserver.ows.DefaultServiceExceptionHandlerTest) ------------------------------------------------------------------------------- Test set: org.geoserver.ows.DefaultServiceExceptionHandlerTest ------------------------------------------------------------------------------- Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.274 sec <<< FAILURE! testHandleServiceExceptionCauses(org.geoserver.ows.DefaultServiceExceptionHandlerTest) Time elapsed: 0.223 sec <<< FAILURE! junit.framework.AssertionFailedError at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.assertTrue(Assert.java:20) at junit.framework.Assert.assertTrue(Assert.java:27) at org.geoserver.ows.DefaultServiceExceptionHandlerTest.testHandleServiceExceptionCauses(DefaultServiceExceptionHandlerTest.java:102) Kind regards, Ben. On 29/06/11 13:20, Justin Deoliveira wrote: > Yeah, the geoserver build uses a custom plugin to copy over a data directory into the webapp. Its pretty outdated as it seems. A full blown plug-in is not really need for that, and actually it just complicates the build. Some inline ant with the antrun plugin in the web/app pom should do the same and be easier to maintain. So I attached a patch to GEOS-4652 that does just that. > > With that and a few other minor tweaks I was able to build geoserver with maven 3. However I did not not run with tests, getting late here So if the other devs could give the patch a spin that would be great. Regardless it should be a decent starting point. > > -Justin > >
          Hide
          Ben Caradoc-Davies added a comment - - edited

          I'm trying to get a full build to work.

          I had to make two more fixes:
          (1) extension/validation has the wrong parent pom (should be extension not geoserver)
          (2) ows DefaultServiceExceptionHandlerTest.testHandleServiceExceptionCauses failure is caused by the exception text being pretty-printed. This is easily fixed by normalising the whitespace. But why does Maven 3 cause this to fail? Everything else is the same? Classloader changes?

          Show
          Ben Caradoc-Davies added a comment - - edited I'm trying to get a full build to work. I had to make two more fixes: (1) extension/validation has the wrong parent pom (should be extension not geoserver) (2) ows DefaultServiceExceptionHandlerTest.testHandleServiceExceptionCauses failure is caused by the exception text being pretty-printed. This is easily fixed by normalising the whitespace. But why does Maven 3 cause this to fail? Everything else is the same? Classloader changes?
          Hide
          Ben Caradoc-Davies added a comment -

          Maven 3 has many failures in main. Eclipse passes. Here is an example:

          -------------------------------------------------------------------------------
          Test set: org.geoserver.security.impl.SecureCatalogIntegrationTest
          -------------------------------------------------------------------------------
          Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0.134 sec <<< FA
          ILURE!
          testFullAccess(org.geoserver.security.impl.SecureCatalogIntegrationTest) Time e
          lapsed: 0.075 sec <<< ERROR!
          java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.getXmlStandalo
          ne()Z
          at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.setDocumentInfo(D
          OM2TO.java:373)
          at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java
          :127)
          at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java
          :94)
          at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor
          mIdentity(TransformerImpl.java:661)
          at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor
          m(TransformerImpl.java:707)
          at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor
          m(TransformerImpl.java:313)
          at org.geoserver.data.CatalogWriter.write(CatalogWriter.java:253)

          Show
          Ben Caradoc-Davies added a comment - Maven 3 has many failures in main. Eclipse passes. Here is an example: ------------------------------------------------------------------------------- Test set: org.geoserver.security.impl.SecureCatalogIntegrationTest ------------------------------------------------------------------------------- Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0.134 sec <<< FA ILURE! testFullAccess(org.geoserver.security.impl.SecureCatalogIntegrationTest) Time e lapsed: 0.075 sec <<< ERROR! java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.getXmlStandalo ne()Z at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.setDocumentInfo(D OM2TO.java:373) at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java :127) at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java :94) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor mIdentity(TransformerImpl.java:661) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor m(TransformerImpl.java:707) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor m(TransformerImpl.java:313) at org.geoserver.data.CatalogWriter.write(CatalogWriter.java:253)
          Hide
          Ben Caradoc-Davies added a comment -

          The failure in main is fixed by adding a xalan test dependency.

          Show
          Ben Caradoc-Davies added a comment - The failure in main is fixed by adding a xalan test dependency.
          Hide
          Ben Caradoc-Davies added a comment -

          And the JRE internal xalan is almost certainly what was causing the changed behaviour in ows DefaultServiceExceptionHandlerTest.testHandleServiceExceptionCauses.

          Andrea, can you explain what is going on? Does this changed behaviour have any implications for deployments if we no longer ship xalan?

          Show
          Ben Caradoc-Davies added a comment - And the JRE internal xalan is almost certainly what was causing the changed behaviour in ows DefaultServiceExceptionHandlerTest.testHandleServiceExceptionCauses. Andrea, can you explain what is going on? Does this changed behaviour have any implications for deployments if we no longer ship xalan?
          Hide
          Ben Caradoc-Davies added a comment -

          Looks like geoserver has too many xercesImpl in the top-level dependencyManagement. I'll try cutting back to one and syncing with GT. (creds to aaime for suggesting cutting something out was the likely solution)

          Show
          Ben Caradoc-Davies added a comment - Looks like geoserver has too many xercesImpl in the top-level dependencyManagement. I'll try cutting back to one and syncing with GT. (creds to aaime for suggesting cutting something out was the likely solution)
          Hide
          Ben Caradoc-Davies added a comment -

          Build fails in WMS unless GEOS-4689 patch is applied.

          Show
          Ben Caradoc-Davies added a comment - Build fails in WMS unless GEOS-4689 patch is applied.
          Hide
          Ben Caradoc-Davies added a comment -

          Success! The attached patch GEOS-4652.complete-including-xercesImpl-and-wms.patch allows GeoServer to be built with Maven 3. It includes the patch for GEOS-4689 and my original GEOS-4685 xercesImpl fixes (although we should use Ian's version which does more). This version includes all of Justin's original patch. It also fixes an ows whitespace problem that might no longer be an issue with xercesImpl 2.7.1, but is better code.

          Show
          Ben Caradoc-Davies added a comment - Success! The attached patch GEOS-4652 .complete-including-xercesImpl-and-wms.patch allows GeoServer to be built with Maven 3. It includes the patch for GEOS-4689 and my original GEOS-4685 xercesImpl fixes (although we should use Ian's version which does more). This version includes all of Justin's original patch. It also fixes an ows whitespace problem that might no longer be an issue with xercesImpl 2.7.1, but is better code.
          Hide
          Ben Caradoc-Davies added a comment -

          Andrea, assembly:attached works as well. The war.zip is 50 MB, so we might be getting a few more included dependencies. (IIRC with m2 it is about 46 MB.)

          Show
          Ben Caradoc-Davies added a comment - Andrea, assembly:attached works as well. The war.zip is 50 MB, so we might be getting a few more included dependencies. (IIRC with m2 it is about 46 MB.)
          Hide
          Ben Caradoc-Davies added a comment -

          GEOS-4652.complete.patch contains just the pom and ows changes, now that Ian has committed the xercesImpl (GEOS-4685) changes. This patch is a superset of GEOS-4652.patch.

          Building with Maven 3 also requires the GEOS-4689 patch, which should be in a separate commit.

          Show
          Ben Caradoc-Davies added a comment - GEOS-4652 .complete.patch contains just the pom and ows changes, now that Ian has committed the xercesImpl ( GEOS-4685 ) changes. This patch is a superset of GEOS-4652 .patch. Building with Maven 3 also requires the GEOS-4689 patch, which should be in a separate commit.
          Hide
          Justin Deoliveira added a comment -

          +1

          Show
          Justin Deoliveira added a comment - +1
          Hide
          Ben Caradoc-Davies added a comment -

          Committed to trunk in r16218.

          Show
          Ben Caradoc-Davies added a comment - Committed to trunk in r16218.
          Hide
          Justin Deoliveira added a comment -

          Reopening in order to reassign to 2.1-beta2 release

          Show
          Justin Deoliveira added a comment - Reopening in order to reassign to 2.1-beta2 release
          Hide
          Andrea Aime added a comment -

          Switching all issues that have been in "resolved" state for more than one month without further comments to "closed" status

          Show
          Andrea Aime added a comment - Switching all issues that have been in "resolved" state for more than one month without further comments to "closed" status

            People

            • Assignee:
              Andrea Aime
              Reporter:
              Ben Caradoc-Davies
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: