Remove ant tasks to run fop and xslt. It will prevent us to load dependencies in the root classloader and it will resolve problems of incompatibility (due to xml parser) with maven 1.0.
An known bug exist with this commit. SVG images rendering fail ! git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@233394 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
3af2deb12c
commit
8478e579e9
2 files changed
+108
-43
No files matched your search
+90
-36
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright 2001-2004 The Apache Software Foundation.
|
||||
* Copyright 2001-2005 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -59,6 +59,8 @@
|
||||
</j:if>
|
||||
<!-- internal variables -->
|
||||
<j:set var="internal_pdf_workingDir" value="${maven.build.dir}/pdf"/>
|
||||
<j:set var="java_version" value="${java.specification.version}"/>
|
||||
<j:set var="maven_version" value="${maven.application.version}"/>
|
||||
<j:if test="${maven.pdf.debug}">
|
||||
<ant:echo>
|
||||
### Debug mode is on ###
|
||||
@@ -89,10 +91,15 @@ maven.pdf.cover.version = [${maven.pdf.cover.version}]
|
||||
maven.pdf.cover.date = [${maven.pdf.cover.date}]
|
||||
maven.pdf.projectLogo = [${maven.pdf.projectLogo}]
|
||||
maven.pdf.companyLogo = [${maven.pdf.companyLogo}]
|
||||
maven.jar.jimi = [${maven.jar.jimi}]
|
||||
maven.jar.jaicore = [${maven.jar.jaicore}]
|
||||
maven.jar.jaicodec = [${maven.jar.jaicodec}]
|
||||
==============================
|
||||
=== pdf internal variables ===
|
||||
==============================
|
||||
internal_pdf_workingDir = [${internal_pdf_workingDir}]
|
||||
java_version = [${java_version}]
|
||||
maven_version = [${maven_version}]
|
||||
</ant:echo>
|
||||
</j:if>
|
||||
<j:if test="not ${maven.pdf.debug}">
|
||||
@@ -119,28 +126,69 @@ internal_pdf_workingDir = [${internal_pdf_workingDir}]
|
||||
</j:if>
|
||||
</j:set>
|
||||
</j:if>
|
||||
<xslt in="${maven.pdf.navigationFilePath}/${maven.pdf.navigationFile}" out="${internal_pdf_workingDir}/project.fo" style="${plugin.resources}/project2fo.xslt" force="true">
|
||||
<param name="basePath" expression="${internal_pdf_workingDir}"/>
|
||||
<param name="confidential" expression="${maven.pdf.confidential}"/>
|
||||
<param name="paperType" expression="${maven.pdf.paperType}"/>
|
||||
<param name="companyIncName" expression="${maven.pdf.companyIncName}"/>
|
||||
<param name="publicationYear" expression="${maven.pdf.copyrightYear}"/>
|
||||
<param name="coverProjectCompany" expression="${maven.pdf.cover.projectCompany}"/>
|
||||
<param name="coverProjectName" expression="${maven.pdf.cover.projectName}"/>
|
||||
<param name="coverType" expression="${maven.pdf.cover.type}"/>
|
||||
<param name="coverVersion" expression="${maven.pdf.cover.version}"/>
|
||||
<param name="coverDate" expression="${maven.pdf.cover.date}"/>
|
||||
<param name="companyLogo" expression="${maven.pdf.companyLogo}"/>
|
||||
<param name="projectLogo" expression="${maven.pdf.projectLogo}"/>
|
||||
<param name="imageDpi" expression="${maven.pdf.imageDpi}"/>
|
||||
<param name="debug" expression="${maven.pdf.debug}"/>
|
||||
</xslt>
|
||||
<java classname="org.apache.xalan.xslt.Process" dir="${internal_pdf_workingDir}" fork="true" failonerror="true">
|
||||
<arg value="-IN"/>
|
||||
<arg value="${maven.pdf.navigationFilePath}/${maven.pdf.navigationFile}"/>
|
||||
<arg value="-XSL"/>
|
||||
<arg value="${plugin.resources}/project2fo.xslt"/>
|
||||
<arg value="-OUT"/>
|
||||
<arg value="${internal_pdf_workingDir}/project.fo"/>
|
||||
<arg value="-PARAM"/>
|
||||
<arg value="basePath"/>
|
||||
<arg value="${internal_pdf_workingDir}"/>
|
||||
<arg value="-PARAM"/>
|
||||
<arg value="confidential"/>
|
||||
<arg value="${maven.pdf.confidential}"/>
|
||||
<arg value="-PARAM"/>
|
||||
<arg value="paperType"/>
|
||||
<arg value="${maven.pdf.paperType}"/>
|
||||
<arg value="-PARAM"/>
|
||||
<arg value="companyIncName"/>
|
||||
<arg value="${maven.pdf.companyIncName}"/>
|
||||
<arg value="-PARAM"/>
|
||||
<arg value="publicationYear"/>
|
||||
<arg value="${maven.pdf.copyrightYear}"/>
|
||||
<arg value="-PARAM"/>
|
||||
<arg value="-PARAM coverProjectCompany ${maven.pdf.cover.projectCompany}"/>
|
||||
<arg value="${maven.pdf.cover.projectCompany}"/>
|
||||
<arg value="-PARAM"/>
|
||||
<arg value="coverProjectName"/>
|
||||
<arg value="${maven.pdf.cover.projectName}"/>
|
||||
<arg value="-PARAM"/>
|
||||
<arg value="coverType"/>
|
||||
<arg value="${maven.pdf.cover.type}"/>
|
||||
<arg value="-PARAM"/>
|
||||
<arg value="coverVersion"/>
|
||||
<arg value="${maven.pdf.cover.version}"/>
|
||||
<arg value="-PARAM"/>
|
||||
<arg value="coverDate"/>
|
||||
<arg value="${maven.pdf.cover.date}"/>
|
||||
<arg value="-PARAM"/>
|
||||
<arg value="companyLogo"/>
|
||||
<arg value="${maven.pdf.companyLogo}"/>
|
||||
<arg value="-PARAM"/>
|
||||
<arg value="projectLogo"/>
|
||||
<arg value="${maven.pdf.projectLogo}"/>
|
||||
<arg value="-PARAM"/>
|
||||
<arg value="imageDpi"/>
|
||||
<arg value="${maven.pdf.imageDpi}"/>
|
||||
<arg value="-PARAM"/>
|
||||
<arg value="debug"/>
|
||||
<arg value="${maven.pdf.debug}"/>
|
||||
<classpath>
|
||||
<pathelement location="${plugin.getDependencyPath('xerces')}"/>
|
||||
<pathelement location="${plugin.getDependencyPath('xalan')}"/>
|
||||
<j:if test="${java_version.compareTo('1.4') lt 0}">
|
||||
<pathelement location="${plugin.getDependencyPath('xml-apis')}"/>
|
||||
</j:if>
|
||||
</classpath>
|
||||
</java>
|
||||
</goal>
|
||||
<goal name="pdf" prereqs="fo:fo,pdf:prepare,pdf:pdf" description="This is the default goal of the plugin and simply pre-requisites the pdf:pdf goal. "/>
|
||||
<goal name="pdf:prepare" prereqs="pdf:init" description="Stages all files needed to generate the PDF">
|
||||
<!-- First, copy all of the generated xdocs -->
|
||||
<copy todir="${internal_pdf_workingDir}">
|
||||
<fileset dir="${maven.xdoc.gen}" force="true">
|
||||
<copy todir="${internal_pdf_workingDir}" force="true" overwrite="true">
|
||||
<fileset dir="${maven.xdoc.gen}">
|
||||
<include name="**/*.*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
@@ -151,7 +199,7 @@ internal_pdf_workingDir = [${internal_pdf_workingDir}]
|
||||
</fileset>
|
||||
</copy>
|
||||
<!-- Then, copy all of images generated -->
|
||||
<copy todir="${internal_pdf_workingDir}" force="true">
|
||||
<copy todir="${internal_pdf_workingDir}" force="true" overwrite="true">
|
||||
<fileset dir="${maven.xdoc.dest}">
|
||||
<include name="**/*.gif"/>
|
||||
<include name="**/*.jpg"/>
|
||||
@@ -159,7 +207,7 @@ internal_pdf_workingDir = [${internal_pdf_workingDir}]
|
||||
</fileset>
|
||||
</copy>
|
||||
<!-- Finally, copy the FOP config file and all of the fonts -->
|
||||
<copy todir="${internal_pdf_workingDir}" force="true">
|
||||
<copy todir="${internal_pdf_workingDir}" force="true" overwrite="true">
|
||||
<fileset dir="${plugin.resources}">
|
||||
<include name="userconfig.xml"/>
|
||||
<include name="fonts/*.*"/>
|
||||
@@ -169,26 +217,32 @@ internal_pdf_workingDir = [${internal_pdf_workingDir}]
|
||||
<goal name="pdf:pdf" description="Generates a PDF document containing all project documentation. The PDF is generated from the .fo file generated in the fo:fo goal." prereqs="pdf:prepare">
|
||||
<echo>Generating ${internal_pdf_workingDir}/${maven.pdf.pdfName} ...</echo>
|
||||
<echo>Config file: ${internal_pdf_workingDir}/userconfig.xml</echo>
|
||||
<taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop">
|
||||
<java classname="org.apache.fop.apps.Fop" dir="${internal_pdf_workingDir}" fork="true" failonerror="true">
|
||||
<sysproperty key="javax.xml.parsers.SAXParserFactory" value="org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
|
||||
<sysproperty key="javax.xml.transform.TransformerFactory" value="org.apache.xalan.processor.TransformerFactoryImpl"/>
|
||||
<arg value="-c"/>
|
||||
<arg value="${internal_pdf_workingDir}/userconfig.xml"/>
|
||||
<j:if test="${maven.pdf.debug}">
|
||||
<arg value="-d"/>
|
||||
</j:if>
|
||||
<arg value="-fo"/>
|
||||
<arg value="${internal_pdf_workingDir}/project.fo"/>
|
||||
<arg value="-pdf"/>
|
||||
<arg value="${internal_pdf_workingDir}/${maven.pdf.pdfName}"/>
|
||||
<classpath>
|
||||
<pathelement location="${plugin.getDependencyPath('fop')}"/>
|
||||
<j:if test="${java_version.compareTo('1.4') lt 0}">
|
||||
<pathelement location="${plugin.getDependencyPath('xml-apis')}"/>
|
||||
</j:if>
|
||||
<pathelement location="${plugin.getDependencyPath('xerces')}"/>
|
||||
<pathelement location="${plugin.getDependencyPath('xalan')}"/>
|
||||
<pathelement location="${plugin.getDependencyPath('batik')}"/>
|
||||
<pathelement location="${plugin.getDependencyPath('avalon-framework')}"/>
|
||||
<pathelement location="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.jar.jimi')}"/>
|
||||
<pathelement location="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.jar.jaicore')}"/>
|
||||
<pathelement location="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.jar.jaicodec')}"/>
|
||||
<pathelement location="${maven.jar.jimi}"/>
|
||||
<pathelement location="${maven.jar.jaicore}"/>
|
||||
<pathelement location="${maven.jar.jaicodec}"/>
|
||||
</classpath>
|
||||
</taskdef>
|
||||
<fop>
|
||||
<ant:setProperty name="basedir" value="${internal_pdf_workingDir}"/>
|
||||
<ant:setProperty name="userconfig" value="${internal_pdf_workingDir}/userconfig.xml"/>
|
||||
<ant:setProperty name="messagelevel" value="info"/>
|
||||
<if test="${maven.pdf.debug}">
|
||||
<ant:setProperty name="messagelevel" value="debug"/>
|
||||
</if>
|
||||
<ant:setProperty name="fofile" value="${internal_pdf_workingDir}/project.fo"/>
|
||||
<ant:setProperty name="outfile" value="${internal_pdf_workingDir}/${maven.pdf.pdfName}"/>
|
||||
</fop>
|
||||
</java>
|
||||
<copy todir="${maven.xdoc.dest}" file="${internal_pdf_workingDir}/${maven.pdf.pdfName}"/>
|
||||
</goal>
|
||||
</project>
|
||||
+18
-7
@@ -118,21 +118,32 @@
|
||||
<version>4.1.5</version>
|
||||
<url>http://avalon.apache.org/framework/</url>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xerces</artifactId>
|
||||
<version>2.4.0</version>
|
||||
<url>http://xml.apache.org/xerces-j/</url>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xml-apis</groupId>
|
||||
<artifactId>xml-apis</artifactId>
|
||||
<version>1.0.b2</version>
|
||||
<url>http://xml.apache.org/commons/</url>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xalan</groupId>
|
||||
<artifactId>xalan</artifactId>
|
||||
<version>2.4.1</version>
|
||||
<url>http://xml.apache.org/xalan-j/</url>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<reports>
|
||||
<report>maven-changes-plugin</report>
|
||||
<report>maven-changelog-plugin</report>
|
||||
<report>maven-file-activity-plugin</report>
|
||||
<report>maven-developer-activity-plugin</report>
|
||||
<report>maven-tasklist-plugin</report>
|
||||
<report>maven-javadoc-plugin</report>
|
||||
<report>maven-jxr-plugin</report>
|
||||
<report>maven-jdepend-plugin</report>
|
||||
<report>maven-checkstyle-plugin</report>
|
||||
<report>maven-junit-report-plugin</report>
|
||||
<report>maven-pdf-plugin</report>
|
||||
<report>maven-pmd-plugin</report>
|
||||
<report>maven-simian-plugin</report>
|
||||
<report>maven-faq-plugin</report>
|
||||
</reports>
|
||||
</project>
|
||||
Reference in new issue
Block a user