1

I want to send my maven reports via mail in the form of pdf. I have come across two plugin: 1-> maven-pdf-plugin 2-> maven-postman-plugin

But i am not able to configure them. It seems maven-pdf-plugin V-1.1 is not compatible with maven 3.0.4. Can someone help me out?

Regards.

Jean-Rémy Revy
  • 5,607
  • 3
  • 39
  • 65
Amit Shakya
  • 1,396
  • 12
  • 27
  • @Jean:- I have read your reply on nearly same kind of post. Have you upgraded your maven from 2.0 to 3.0 yet. If yes you can give a solution for this.. :) – Amit Shakya Aug 20 '12 at 13:20
  • Ehehe, I was effectively thinking of looking again to my post :). I don't have (or don't remember) any problems with Maven 3.0.4. I would try it again in a couple of weeks (I'm in holiday and don't have my professional computer nearly) – Jean-Rémy Revy Aug 20 '12 at 13:54
  • Indeed, we use Maven 2.1.11 and Maven 3.0.4 without any issues ... but i will try it in order to be sure – Jean-Rémy Revy Aug 20 '12 at 14:00
  • Could you provide us you pom please ? – Jean-Rémy Revy Aug 21 '12 at 14:28

1 Answers1

0

Here my configuration, and I don't remember to have hany issue with maven 3 (3.0.4 at least). I'm using :

  • Maven 3.0.4
  • maven-pdf-plugin : 1.1
  • maven-site : 3.0
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
<build>
    <extensions>
        <!-- Enabling the use of FTP -->
        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-ftp</artifactId>
            <version>2.2</version>
        </extension>
    </extensions>

    <plugins>
        <!-- Génération d'un PDF à l'identique du site maven -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pdf-plugin</artifactId>
            <executions>
                <execution>
                    <id>pdf</id>
                    <phase>site</phase>
                    <goals>
                        <goal>pdf</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.reporting.outputDirectory}</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
    <!-- Gestion des plugins pour ce projet et ses sous modules -->
    <pluginManagement>
        <plugins>
            <!-- Indication de compilation sur la version de Java à utiliser -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>


            <!-- Gestion du tagage des releases -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.2.2</version>
                <configuration>
                    <tagBase>http://svn.xxx.fr.sopra/corprepo/svn/myproject/repository/tags/</tagBase>
                    <scmCommentPrefix>[DEV#GCL]</scmCommentPrefix>
                </configuration>
            </plugin>

            <!-- Gestion de la fabrication du site maven -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <locales>fr</locales>
                    <outputEncoding>UTF-8</outputEncoding>
                </configuration>
            </plugin>
            <!-- Génération d'un PDF à l'identique du site maven -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pdf-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <id>pdf</id>
                        <phase>site</phase>
                        <goals>
                            <goal>pdf</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.reporting.outputDirectory}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

    </pluginManagement>
</build>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - Reporting & GCL - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.8.1</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <version>2.9.1</version>
            <configuration>
                <configLocation>/src/main/config/checkstyle-sopra.xml</configLocation>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>2.12</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>2.7.1</version>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jxr-plugin</artifactId>
            <version>2.3</version>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>2.4</version>
            <reportSets>
                <reportSet>
                    <reports>
                        <report>summary</report>
                        <report>modules</report>
                        <report>project-team</report>
                        <report>mailing-list</report>
                        <report>cim</report>
                        <report>issue-tracking</report>
                        <report>license</report>
                        <report>scm</report>
                    </reports>
                </reportSet>
            </reportSets>
        </plugin>
    </plugins>
</reporting>

And my src/main/pdf.xml

<document xmlns="http://maven.apache.org/DOCUMENT/1.0.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DOCUMENT/1.0.1 http://maven.apache.org/xsd/document-1.0.1.xsd"
outputName="${project.artifactId}">

     <meta>
      <title>Maven PDF Plugin</title>
      <author>The Apache Maven Project</author>
 </meta>

 <toc name="Table of Contents">
      <item name="Introduction" ref="index.apt"/>

 </toc>

 <cover>
      <coverTitle>${project.name}</coverTitle>
      <coverSubTitle>v. ${project.version}</coverSubTitle>
      <coverType>User Guide</coverType>
      <projectName>${project.name}</projectName>
      <projectLogo>images/logo_myorg.png</projectLogo>
      <companyName>${project.organization.name}</companyName>
      <companyLogo>images/logo_myorg.png</companyLogo>
 </cover>

I'll give a try asap.

Where your process is bugging ? only with pdf creation, or when e-mailing ?

Jean-Rémy Revy
  • 5,607
  • 3
  • 39
  • 65
  • It is throwing this error.. [ERROR] Failed to execute goal `org.apache.maven.plugins:maven-pdf-plugin:1.1:pdf` (pdf) on project AutomationBuild9: Execution pdf of goal org.apache.maven.plugins:maven-pdf-plugin:1.1:pdf failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-pdf-plugin:1.1:pdf:java.lang.NoSuchMe thodError: org.apache.maven.plugin.PluginManager.verifyReportPlugin(Lorg/apache/ maven/model/ReportPlugin;Lorg/apache/maven/project/MavenProject;Lorg/apache/mave n/execution/MavenSession;)Lorg/apache/maven/plugin/descriptor/PluginDescriptor; – Amit Shakya Aug 21 '12 at 13:39
  • It is throwing error during the creation of PDF. This is an incompatibility issue. – Amit Shakya Aug 21 '12 at 13:43
  • Maybe you declared womething wrong, or something is missing. Did you specified each version of plugin ? Did you use a specific subset of reports ? – Jean-Rémy Revy Aug 21 '12 at 14:30
  • Thanks a lot Jean. It worked partially but i will get it working, stuck up with something else. :) – Amit Shakya Sep 06 '12 at 06:23