You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by leviathani <ba...@gmail.com> on 2008/08/11 14:54:30 UTC

Classpath problems with Javadoc plugin (mvn site:site)

Hello!

I am new to maven and want to create a Javadoc PDF in an automated way. I
adapted PDFDoclet[1] for this purpose. This doclet is depending on log4j as
well as some other libraries.

However, I always receive an error when i try to build this documentation
with mvn site:site, namely:

---------------------------------------------------------
[INFO] Error during page generation

Embedded error: Error rendering Maven report: Exit code: 1 -
java.lang.NoClassDefFoundError: org/apache/log4j/Logger
---------------------------------------------------------

This happens upon invocation of PDFDoclet, which I have included in the
reporting section:
---------------------------------------------------------
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <id>pdf</id>
                        <configuration>
                            <name>PDF API documentation</name>
                            <description>A Java API documentation in PDF
Format.</description>
                           
<doclet>org.mycompany.javadoc.pdfdoclet.PDFDoclet</doclet>
                            <docletArtifact>
                                <groupId>org.mycompany.javadoc</groupId>
                                <artifactId>pdfdoclet</artifactId>
                                <version></version>
                            </docletArtifact>
                            <maxmemory>256m</maxmemory>
                            <additionalparam>-pdf api.pdf -config
src/main/resources/pdfdoclet.properties</additionalparam>
                           
<sourcepath>${project.build.directory}/sources</sourcepath>
                            <destDir>pdf</destDir>
                            <show>public</show>
                        </configuration>
                        <reports>
                            <report>javadoc</report>
                        </reports>
                    </reportSet>
                 <!-- MORE STUFF IN HERE  -->
                </reportSets>
            </plugin>
        </plugins>
    </reporting>
---------------------------------------------------------

Log4j is in the dependencies section of my pom.xml. However, it looks like
the dependency on log4j is ignored in this case.

Is there a way to tell maven that it should put log4j into the classpath
when invoking the javadoc plugin? I want to avoid having to write a plugin
for this if it is not necessary. Nevertheless, this would be my workaround
if I cannot find a solution to this problem.

TIA && kind regards,
Gernot

[1]: http://pdfdoclet.sourceforge.net/
-- 
View this message in context: http://www.nabble.com/Classpath-problems-with-Javadoc-plugin-%28mvn-site%3Asite%29-tp18925313p18925313.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Classpath problems with Javadoc plugin (mvn site:site)

Posted by Nick Stolwijk <ni...@gmail.com>.
I have seen that issue before, but hadn't thought of it. Take a look at [1].
You have to configure it inside the <build><plugins><plugin> element.

Hth,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl

[1]
http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html

On Mon, Aug 11, 2008 at 3:59 PM, leviathani <ba...@gmail.com> wrote:

>
> Hello!
>
> I tried your advice, but it didn't work (or at least it didn't work the way
> i tried it). I googled a bit and found the following issue:
> http://jira.codehaus.org/browse/MNG-1931
>
> It seems like I cannot use the pluginManagement section if I want to create
> the report using mvn site:site. Did I get this correctly? If yes, I have to
> find a different way to achieve my goal.
>
> Thank you for your help so far,
> Kind Regards,
> Gernot
>
>
> Nick Stolwijk-4 wrote:
> >
> > Put it inside the pluginManagement section. There you can configure the
> > plugins you use in the reporting section.
> >
> > Hth,
> >
> > Nick Stolwijk
> > ~Java Developer~
> >
> > Iprofs BV.
> > Claus Sluterweg 125
> > 2012 WS Haarlem
> > www.iprofs.nl
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Classpath-problems-with-Javadoc-plugin-%28mvn-site%3Asite%29-tp18925313p18926390.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Classpath problems with Javadoc plugin (mvn site:site)

Posted by leviathani <ba...@gmail.com>.
Hello!

I tried your advice, but it didn't work (or at least it didn't work the way
i tried it). I googled a bit and found the following issue:
http://jira.codehaus.org/browse/MNG-1931

It seems like I cannot use the pluginManagement section if I want to create
the report using mvn site:site. Did I get this correctly? If yes, I have to
find a different way to achieve my goal.

Thank you for your help so far,
Kind Regards,
Gernot


Nick Stolwijk-4 wrote:
> 
> Put it inside the pluginManagement section. There you can configure the
> plugins you use in the reporting section.
> 
> Hth,
> 
> Nick Stolwijk
> ~Java Developer~
> 
> Iprofs BV.
> Claus Sluterweg 125
> 2012 WS Haarlem
> www.iprofs.nl
> 
> 

-- 
View this message in context: http://www.nabble.com/Classpath-problems-with-Javadoc-plugin-%28mvn-site%3Asite%29-tp18925313p18926390.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Classpath problems with Javadoc plugin (mvn site:site)

Posted by Nick Stolwijk <ni...@gmail.com>.
Put it inside the pluginManagement section. There you can configure the
plugins you use in the reporting section.

Hth,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl

On Mon, Aug 11, 2008 at 3:24 PM, leviathani <ba...@gmail.com> wrote:

>
> Hello!
>
> I looked through the Maven model (thank you for the link BTW, I was
> searching for something like this), but to no avail. There seems to be no
> possibility to put dependencies somewhere into the reporting section. The
> relevant parts of the model are:
>
>
> --------------------------------------------------
>      <reporting>
>        <excludeDefaults/>
>        <outputDirectory/>
>        <plugins>
>          <plugin>
>            <groupId/>
>            <artifactId/>
>            <version/>
>            <inherited/>
>            <configuration/>
>            <reportSets>
>              <reportSet>
>                <id/>
>                <configuration/>
>                <inherited/>
>                <reports/>
>              </reportSet>
>            </reportSets>
>          </plugin>
>        </plugins>
>      </reporting>
> --------------------------------------------------
>
> I tried to add the dependencies section at several points, but Maven
> immediately stopped with a parse error regarding the POM file.
>
> Did I just screw up or is there no possibility to add a dependency? I don't
> like Mondays... :/
>
> Thanks and
>
> Kind Regards,
> Gernot
>
>
>
> Nick Stolwijk-4 wrote:
> >
> > As you can see in the Maven Model [1] the plugin element has the option
> to
> > include a dependencies tag. This will put dependencies on the classpath
> of
> > the plugin.
> >
> > Hth,
> >
> > Nick Stolwijk
> > ~Java Developer~
> >
> > Iprofs BV.
> > Claus Sluterweg 125
> > 2012 WS Haarlem
> > www.iprofs.nl
> >
> >
> > [1] http://maven.apache.org/ref/2.0.7/maven-model/maven.html
> >
> > On Mon, Aug 11, 2008 at 2:54 PM, leviathani <ba...@gmail.com>
> > wrote:
> >
> >>
> >> Hello!
> >>
> >> I am new to maven and want to create a Javadoc PDF in an automated way.
> I
> >> adapted PDFDoclet[1] for this purpose. This doclet is depending on log4j
> >> as
> >> well as some other libraries.
> >>
> >> However, I always receive an error when i try to build this
> documentation
> >> with mvn site:site, namely:
> >>
> >> ---------------------------------------------------------
> >> [INFO] Error during page generation
> >>
> >> Embedded error: Error rendering Maven report: Exit code: 1 -
> >> java.lang.NoClassDefFoundError: org/apache/log4j/Logger
> >> ---------------------------------------------------------
> >>
> >> This happens upon invocation of PDFDoclet, which I have included in the
> >> reporting section:
> >> ---------------------------------------------------------
> >>    <reporting>
> >>        <plugins>
> >>            <plugin>
> >>                <groupId>org.apache.maven.plugins</groupId>
> >>                <artifactId>maven-javadoc-plugin</artifactId>
> >>                <reportSets>
> >>                    <reportSet>
> >>                        <id>pdf</id>
> >>                        <configuration>
> >>                            <name>PDF API documentation</name>
> >>                            <description>A Java API documentation in PDF
> >> Format.</description>
> >>
> >> <doclet>org.mycompany.javadoc.pdfdoclet.PDFDoclet</doclet>
> >>                            <docletArtifact>
> >>                                <groupId>org.mycompany.javadoc</groupId>
> >>                                <artifactId>pdfdoclet</artifactId>
> >>                                <version></version>
> >>                            </docletArtifact>
> >>                            <maxmemory>256m</maxmemory>
> >>                            <additionalparam>-pdf api.pdf -config
> >> src/main/resources/pdfdoclet.properties</additionalparam>
> >>
> >> <sourcepath>${project.build.directory}/sources</sourcepath>
> >>                            <destDir>pdf</destDir>
> >>                            <show>public</show>
> >>                        </configuration>
> >>                        <reports>
> >>                            <report>javadoc</report>
> >>                        </reports>
> >>                    </reportSet>
> >>                 <!-- MORE STUFF IN HERE  -->
> >>                </reportSets>
> >>            </plugin>
> >>        </plugins>
> >>    </reporting>
> >> ---------------------------------------------------------
> >>
> >> Log4j is in the dependencies section of my pom.xml. However, it looks
> >> like
> >> the dependency on log4j is ignored in this case.
> >>
> >> Is there a way to tell maven that it should put log4j into the classpath
> >> when invoking the javadoc plugin? I want to avoid having to write a
> >> plugin
> >> for this if it is not necessary. Nevertheless, this would be my
> >> workaround
> >> if I cannot find a solution to this problem.
> >>
> >> TIA && kind regards,
> >> Gernot
> >>
> >> [1]: http://pdfdoclet.sourceforge.net/
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Classpath-problems-with-Javadoc-plugin-%28mvn-site%3Asite%29-tp18925313p18925313.html
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Classpath-problems-with-Javadoc-plugin-%28mvn-site%3Asite%29-tp18925313p18925829.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl

Re: Classpath problems with Javadoc plugin (mvn site:site)

Posted by leviathani <ba...@gmail.com>.
Hello!

I looked through the Maven model (thank you for the link BTW, I was
searching for something like this), but to no avail. There seems to be no
possibility to put dependencies somewhere into the reporting section. The
relevant parts of the model are:


--------------------------------------------------
      <reporting>
        <excludeDefaults/>
        <outputDirectory/>
        <plugins>
          <plugin>
            <groupId/>
            <artifactId/>
            <version/>
            <inherited/>
            <configuration/>
            <reportSets>
              <reportSet>
                <id/>
                <configuration/>
                <inherited/>
                <reports/>
              </reportSet>
            </reportSets>
          </plugin>
        </plugins>
      </reporting>
--------------------------------------------------

I tried to add the dependencies section at several points, but Maven
immediately stopped with a parse error regarding the POM file.

Did I just screw up or is there no possibility to add a dependency? I don't
like Mondays... :/

Thanks and

Kind Regards,
Gernot



Nick Stolwijk-4 wrote:
> 
> As you can see in the Maven Model [1] the plugin element has the option to
> include a dependencies tag. This will put dependencies on the classpath of
> the plugin.
> 
> Hth,
> 
> Nick Stolwijk
> ~Java Developer~
> 
> Iprofs BV.
> Claus Sluterweg 125
> 2012 WS Haarlem
> www.iprofs.nl
> 
> 
> [1] http://maven.apache.org/ref/2.0.7/maven-model/maven.html
> 
> On Mon, Aug 11, 2008 at 2:54 PM, leviathani <ba...@gmail.com>
> wrote:
> 
>>
>> Hello!
>>
>> I am new to maven and want to create a Javadoc PDF in an automated way. I
>> adapted PDFDoclet[1] for this purpose. This doclet is depending on log4j
>> as
>> well as some other libraries.
>>
>> However, I always receive an error when i try to build this documentation
>> with mvn site:site, namely:
>>
>> ---------------------------------------------------------
>> [INFO] Error during page generation
>>
>> Embedded error: Error rendering Maven report: Exit code: 1 -
>> java.lang.NoClassDefFoundError: org/apache/log4j/Logger
>> ---------------------------------------------------------
>>
>> This happens upon invocation of PDFDoclet, which I have included in the
>> reporting section:
>> ---------------------------------------------------------
>>    <reporting>
>>        <plugins>
>>            <plugin>
>>                <groupId>org.apache.maven.plugins</groupId>
>>                <artifactId>maven-javadoc-plugin</artifactId>
>>                <reportSets>
>>                    <reportSet>
>>                        <id>pdf</id>
>>                        <configuration>
>>                            <name>PDF API documentation</name>
>>                            <description>A Java API documentation in PDF
>> Format.</description>
>>
>> <doclet>org.mycompany.javadoc.pdfdoclet.PDFDoclet</doclet>
>>                            <docletArtifact>
>>                                <groupId>org.mycompany.javadoc</groupId>
>>                                <artifactId>pdfdoclet</artifactId>
>>                                <version></version>
>>                            </docletArtifact>
>>                            <maxmemory>256m</maxmemory>
>>                            <additionalparam>-pdf api.pdf -config
>> src/main/resources/pdfdoclet.properties</additionalparam>
>>
>> <sourcepath>${project.build.directory}/sources</sourcepath>
>>                            <destDir>pdf</destDir>
>>                            <show>public</show>
>>                        </configuration>
>>                        <reports>
>>                            <report>javadoc</report>
>>                        </reports>
>>                    </reportSet>
>>                 <!-- MORE STUFF IN HERE  -->
>>                </reportSets>
>>            </plugin>
>>        </plugins>
>>    </reporting>
>> ---------------------------------------------------------
>>
>> Log4j is in the dependencies section of my pom.xml. However, it looks
>> like
>> the dependency on log4j is ignored in this case.
>>
>> Is there a way to tell maven that it should put log4j into the classpath
>> when invoking the javadoc plugin? I want to avoid having to write a
>> plugin
>> for this if it is not necessary. Nevertheless, this would be my
>> workaround
>> if I cannot find a solution to this problem.
>>
>> TIA && kind regards,
>> Gernot
>>
>> [1]: http://pdfdoclet.sourceforge.net/
>> --
>> View this message in context:
>> http://www.nabble.com/Classpath-problems-with-Javadoc-plugin-%28mvn-site%3Asite%29-tp18925313p18925313.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Classpath-problems-with-Javadoc-plugin-%28mvn-site%3Asite%29-tp18925313p18925829.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Classpath problems with Javadoc plugin (mvn site:site)

Posted by Nick Stolwijk <ni...@gmail.com>.
As you can see in the Maven Model [1] the plugin element has the option to
include a dependencies tag. This will put dependencies on the classpath of
the plugin.

Hth,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl


[1] http://maven.apache.org/ref/2.0.7/maven-model/maven.html

On Mon, Aug 11, 2008 at 2:54 PM, leviathani <ba...@gmail.com> wrote:

>
> Hello!
>
> I am new to maven and want to create a Javadoc PDF in an automated way. I
> adapted PDFDoclet[1] for this purpose. This doclet is depending on log4j as
> well as some other libraries.
>
> However, I always receive an error when i try to build this documentation
> with mvn site:site, namely:
>
> ---------------------------------------------------------
> [INFO] Error during page generation
>
> Embedded error: Error rendering Maven report: Exit code: 1 -
> java.lang.NoClassDefFoundError: org/apache/log4j/Logger
> ---------------------------------------------------------
>
> This happens upon invocation of PDFDoclet, which I have included in the
> reporting section:
> ---------------------------------------------------------
>    <reporting>
>        <plugins>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-javadoc-plugin</artifactId>
>                <reportSets>
>                    <reportSet>
>                        <id>pdf</id>
>                        <configuration>
>                            <name>PDF API documentation</name>
>                            <description>A Java API documentation in PDF
> Format.</description>
>
> <doclet>org.mycompany.javadoc.pdfdoclet.PDFDoclet</doclet>
>                            <docletArtifact>
>                                <groupId>org.mycompany.javadoc</groupId>
>                                <artifactId>pdfdoclet</artifactId>
>                                <version></version>
>                            </docletArtifact>
>                            <maxmemory>256m</maxmemory>
>                            <additionalparam>-pdf api.pdf -config
> src/main/resources/pdfdoclet.properties</additionalparam>
>
> <sourcepath>${project.build.directory}/sources</sourcepath>
>                            <destDir>pdf</destDir>
>                            <show>public</show>
>                        </configuration>
>                        <reports>
>                            <report>javadoc</report>
>                        </reports>
>                    </reportSet>
>                 <!-- MORE STUFF IN HERE  -->
>                </reportSets>
>            </plugin>
>        </plugins>
>    </reporting>
> ---------------------------------------------------------
>
> Log4j is in the dependencies section of my pom.xml. However, it looks like
> the dependency on log4j is ignored in this case.
>
> Is there a way to tell maven that it should put log4j into the classpath
> when invoking the javadoc plugin? I want to avoid having to write a plugin
> for this if it is not necessary. Nevertheless, this would be my workaround
> if I cannot find a solution to this problem.
>
> TIA && kind regards,
> Gernot
>
> [1]: http://pdfdoclet.sourceforge.net/
> --
> View this message in context:
> http://www.nabble.com/Classpath-problems-with-Javadoc-plugin-%28mvn-site%3Asite%29-tp18925313p18925313.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>