Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Maven Integration advancement

2004-11-16
2013-04-17
  • Hi Edouard

    Let continu the discution we start out ligne here.

    At the moment, I have identify the properterties used by the ant task in the ant test script.

    Can I know I you have priority in the integration : ie one of the ant test case first ?

     
    • In order to discover those priorities, I propose that you take a look at the Ant buildfile that is currently being used (see via CVS at the root of the project, or browse http://xmlreleasenotes.free.fr/AntDoc_top.html\).

      The main idea is to enable the end-user to trigger the release notes generation from the XRN file.

      The rest is optional for the moment...

       
    • The begin of the plugin is write as the ant task but then exception !

      xmlreleasenote:
          [XMLReleaseNotes] The HTML stuff will be generated into the directory 'D:\java\myProjects\XMLReleaseNotes\source\maven-plugin\src\plugin-te
      st\target\releasenote'
          [XMLReleaseNotes] The CSS file provided 'D:\java\myProjects\XMLReleaseNotes\source\maven-plugin\src\plugin-test' does not exist: the defaul
      t one will be used instead
          [XMLReleaseNotes] Handling the individual release notes files
          [XMLReleaseNotes] No preliminar XSL transformation used
          [XMLReleaseNotes] Using the mutiple-HTML-page for the layout transformation
          [XMLReleaseNotes] [ERROR] Cannot find any XSLT implementation present in the classpath
      ...
      Caused by: javax.xml.transform.TransformerFactoryConfigurationError: Provider for javax.xml.transform.TransformerFactory cannot be found
              at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
              at org.ed.pack.xmlreleasenotes.XMLReleaseNotes.getActualTransformerFactory(XMLReleaseNotes.java:2590)

      I consult the doc but jars seem to left.
      My classpath is :

      Verifying dependencies for xmlreleasenote:maven-xmlreleasenote-plugin
      Processing dependencies for project maven-xmlreleasenote-plugin; classloader [ForeheadClassLoader: name="root.maven"]
      adding dependency C:\Documents and Settings\Propritaire\.maven\repository\xmlreleasenote\jars\XMLReleaseNotes-0.17.1.jar into project classloader
      adding dependency C:\Documents and Settings\Propritaire\.maven\repository\xalan\jars\xalan-2.5.1.jar into project classloader
      adding dependency C:\Documents and Settings\Propritaire\.maven\repository\xerces\jars\xercesImpl-2.4.0.jar into project classloader
      adding dependency C:\Documents and Settings\Propritaire\.maven\repository\xml-apis\jars\xml-apis-2.0.2.jar into project classloader
      adding dependency C:\Documents and Settings\Propritaire\.maven\repository\ant\jars\ant-1.6.1.jar into project classloader

      Edouard can you provide the content of the classpath you use ?

       
      • OK, Nicolas, your classpath seems to be just fine.

        As the message explains it, the runtime cannot find a class that implements the Java interface 'javax.xml.transform.TransformerFactory.TransformerFactory' that should be part of the classpath since you include the 'xalan.jar'...

        The question is what version of JRE you are actually running. Because, from V1.4, there is a kind of "endorsment" feature that forces the user to set the plugin jar implementations that are expected. See http://antdoc.free.fr/requirement_content.php and search for the 'endosed' keyword, that might help.

        Otherwise, run the wrapped XRN Ant task under Ant 'verbose' or even 'debug' in order to better understand what's going underwood...

        I can advise you to create a new Java project in your IDE and try to run the XRN Ant task from there in order to debug... Look at the build.xml in order to understand and exacty see the task compilation classpath, as well as examples in that same builfile.

        Ask for help if you get lost... Good luck, we all know how defeating this might be to discover how to set properly the Java classpath ;-))

         
    • I just try what you sugest but it don't change any thing.
      I use j2sdk1.4.2_01.

      Do you want me to send you the plugin to see if it is a problem of my environement ?

      I continue to search...

       
    • OK, send me the Maven plugin. I'll test it.

       
    • I found but it seem strange I thougth that it was done by default but you need to have a properties to say witch factory implementation you need to use :

      maven plugin:test -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl

      This command line seems to solve the classpath issue.

      I think it is the same thing with ant, you need to define :

      ANT_OPTS=-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl 

       
      • OK, fine, good job for your finding (this was not that esay to find out).

        Yes, this Java system property is very important because it sets the default XSLT factory implementation.

        I dare thinking that this occurs from V1.4+ (with endorsement). However, if you run the Ant XRN task with the '-verbose' option, you should see this class FQN...

        We still need to check what has to be done in order to make the Ant task stable...

         
    • The plugin work ;)

      For your info about the problem with the XMLCatalog, it was solved by have ant-1.5.2 instead of 1.6.X

      I now have a last problem :

          [XMLReleaseNotes] Handling the individual release notes files
          [XMLReleaseNotes] No preliminar XSL transformation used
          [XMLReleaseNotes] Using a single-HTML-page for the layout transformation
          [XMLReleaseNotes] error during XSLT: 'Exception d'E/S avec le fichier de feuille de style : XMLReleaseNotes2HTML.xsl; Lin
      e#: 62; Column#: 47
          [XMLReleaseNotes] [ERROR] fatalError during XSLT: 'org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made t
      o insert a node where it is not permitted.
          [XMLReleaseNotes] Handling the multiple release notes files
      BUILD SUCCESSFUL

      I probably use an invalide xsl

       
    • News concerning this.

      I have fixed the XRN runtime bug when running it from Maven. It only works under JRE V1.4 for the moment (since the Xalan implementation is shipped in that version).

      The problem was coming from the URIResolver that did not manage to find the .xsl present in the XRN jar file. In order to fix this, I added a 'URIResolverPath' inner element in the Ant task, and you need to provide the XRN Ant jar in order to make it work.

      I'm now working on the fact that it also works under JRE V1.3 and think of a way to indicate where the XSLT Factory implementation should be taken from. This is not that easy and I have to fight with Java ClassLoader...

      This means that the XRN is now usable from Maven! Good point. Please, tell me if you succeed in using it.

      Edouard