Java11 and javadoc plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Java11 and javadoc plugin

Thomas Scheffler
Hi,

I have serious problems getting any maven-javadoc-plugin >= 3.1.0 to work with simply Java 11 test case:

Neither will „mvn javadoc:javadoc“ nor „mvn javadoc:jar“ nor „mvn site“ work out-of-the-box. I have to add „compile“ in the middle to get the javadoc-plugin work but this will not fix the site generation.

What’s wrong with the pom.xml or with maven (using version 3.6.3)?

I created a small test project on github: https://github.com/yagee-de/javadoc-test

The output I get is like:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar (default-cli) on project test: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - error: module not found: de.yagee.test
[ERROR]
[ERROR] Command line was: /Users/yagee/Java/Home/11/bin/javadoc @options @packages @argfile
[ERROR]
[ERROR] Refer to the generated Javadoc files in '/Users/yagee/git/javadoc-test/target/apidocs' dir.
[ERROR]
[ERROR] -> [Help 1]

Any help is highly appreciated!

Kind regards,

Thomas

smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Java11 and javadoc plugin

Benjamin Marwell
Hi Thomas,

I tested your configuration and found the same issue – however, it may
not be an issue after all.

You configured your javadoc plugin as part of the reporting section.
This usually requires the compile goal.

Even if you add the jar goal to the default build->plugin section, it
will still require compile to be executed. This is expected and
documented in [2]:
"Requires dependency resolution of artifacts in scope: compile. &&
Binds by default to the lifecycle phase: package."

Same description for the javadoc:javadoc goal.

"mvn package site" will work because "package" includes the "compile"
goal from the default lifecycle.

site (on its own) however is it's own lifecycle and goal and does not
contain the default's lifecycle compile goal. See [1].

Everything you reported works as expected. From what I can tell it
shouldn’t have worked with other java versions and/or other javadoc
plugin versions either.

Does this help you? If not, maybe you might want to explain your
execution idea instead. This will help us getting an idea of what you
are trying to achieve.

Best regards,
Ben

[1] https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
[2] https://maven.apache.org/plugins/maven-javadoc-plugin/jar-mojo.html

Am Mo., 26. Okt. 2020 um 12:49 Uhr schrieb Thomas Scheffler
<[hidden email]>:

>
> Hi,
>
> I have serious problems getting any maven-javadoc-plugin >= 3.1.0 to work with simply Java 11 test case:
>
> Neither will „mvn javadoc:javadoc“ nor „mvn javadoc:jar“ nor „mvn site“ work out-of-the-box. I have to add „compile“ in the middle to get the javadoc-plugin work but this will not fix the site generation.
>
> What’s wrong with the pom.xml or with maven (using version 3.6.3)?
>
> I created a small test project on github: https://github.com/yagee-de/javadoc-test
>
> The output I get is like:
>
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar (default-cli) on project test: MavenReportException: Error while generating Javadoc:
> [ERROR] Exit code: 1 - error: module not found: de.yagee.test
> [ERROR]
> [ERROR] Command line was: /Users/yagee/Java/Home/11/bin/javadoc @options @packages @argfile
> [ERROR]
> [ERROR] Refer to the generated Javadoc files in '/Users/yagee/git/javadoc-test/target/apidocs' dir.
> [ERROR]
> [ERROR] -> [Help 1]
>
> Any help is highly appreciated!
>
> Kind regards,
>
> Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Java11 and javadoc plugin

Thomas Scheffler
Hi,

thanks for looking into it. I updated the project a bit so that you can easily switch the version with „-Djavadoc.plugin.version=3.0.1“ to see it working nice with „mvn site“ and „mvn javadoc:javadoc“. My problem is, that I don’t know how to make „site“ run again. „mvn compile site“ will prevent the errors for the main javadocs but will fail on test javadocs (Junit tests):

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.9.1:site (default-site) on project test: Error generating maven-javadoc-plugin:3.2.0:test-aggregate-no-fork report:
[ERROR] Exit code: 2 - javadoc: error - No source files for package de.yagee.test
[ERROR]
[ERROR] Command line was: /Users/yagee/Java/Home/14/bin/javadoc @options @packages
[ERROR]
[ERROR] Refer to the generated Javadoc files in '/Users/yagee/git/javadoc-test/target/site/testapidocs' dir.
[ERROR] -> [Help 1]

I can stick with 3.0.1 for a while, but of cause I want to move forward. I set up the minimal project to get this figured out, but I lost.

Looking at https://maven.apache.org/plugins/maven-javadoc-plugin/usage.html, there is even no hint on suddenly requiring „compile“ starting with version 1.1.0. Still the site issue drives me nuts, too.

Thanks again for helping me!

kind regards,

Thomas

Am 27.10.2020 um 19:55 schrieb Benjamin Marwell <[hidden email]>:

Hi Thomas,

I tested your configuration and found the same issue – however, it may
not be an issue after all.

You configured your javadoc plugin as part of the reporting section.
This usually requires the compile goal.

Even if you add the jar goal to the default build->plugin section, it
will still require compile to be executed. This is expected and
documented in [2]:
"Requires dependency resolution of artifacts in scope: compile. &&
Binds by default to the lifecycle phase: package."

Same description for the javadoc:javadoc goal.

"mvn package site" will work because "package" includes the "compile"
goal from the default lifecycle.

site (on its own) however is it's own lifecycle and goal and does not
contain the default's lifecycle compile goal. See [1].

Everything you reported works as expected. From what I can tell it
shouldn’t have worked with other java versions and/or other javadoc
plugin versions either.

Does this help you? If not, maybe you might want to explain your
execution idea instead. This will help us getting an idea of what you
are trying to achieve.

Best regards,
Ben

[1] https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
[2] https://maven.apache.org/plugins/maven-javadoc-plugin/jar-mojo.html

Am Mo., 26. Okt. 2020 um 12:49 Uhr schrieb Thomas Scheffler
<[hidden email]>:

Hi,

I have serious problems getting any maven-javadoc-plugin >= 3.1.0 to work with simply Java 11 test case:

Neither will „mvn javadoc:javadoc“ nor „mvn javadoc:jar“ nor „mvn site“ work out-of-the-box. I have to add „compile“ in the middle to get the javadoc-plugin work but this will not fix the site generation.

What’s wrong with the pom.xml or with maven (using version 3.6.3)?

I created a small test project on github: https://github.com/yagee-de/javadoc-test

The output I get is like:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar (default-cli) on project test: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - error: module not found: de.yagee.test
[ERROR]
[ERROR] Command line was: /Users/yagee/Java/Home/11/bin/javadoc @options @packages @argfile
[ERROR]
[ERROR] Refer to the generated Javadoc files in '/Users/yagee/git/javadoc-test/target/apidocs' dir.
[ERROR]
[ERROR] -> [Help 1]

Any help is highly appreciated!

Kind regards,

Thomas

---------------------------------------------------------------------
To unsubscribe, [hidden email]
For additional commands, [hidden email]




smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Java11 and javadoc plugin

Benjamin Marwell-2
Hi Thomas,

no worry, that is as easy to fix as the previous one.

Read carefully:
> Error generating maven-javadoc-plugin:3.2.0:test-aggregate-no-fork

The javadoc-plugin executes "test-aggregate-no-fork".

Which means: It creates javadoc for your TEST classes from src/test/java.
That again requires the "test" goal to be run first [1].
> Requires dependency resolution of artifacts in scope: test.

I rarely found it useful to generate, validate and publish javadoc for
test classes.

Long story short:
mvn test site # (test includes compile).

Although imho, you will always want to execute "mvn verify" (or "mvn
clean verify") anyway, wouldn’t you? ;-)
This is considered a good habit by Robert Scholte iirc.

If you need more information on the "why", don’t hesitate to ask! :)

[1] https://maven.apache.org/plugins/maven-javadoc-plugin/test-aggregate-no-fork-mojo.html

Am Mi., 28. Okt. 2020 um 14:45 Uhr schrieb Thomas Scheffler
<[hidden email]>:

>
> Hi,
>
> thanks for looking into it. I updated the project a bit so that you can easily switch the version with „-Djavadoc.plugin.version=3.0.1“ to see it working nice with „mvn site“ and „mvn javadoc:javadoc“. My problem is, that I don’t know how to make „site“ run again. „mvn compile site“ will prevent the errors for the main javadocs but will fail on test javadocs (Junit tests):
>
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.9.1:site (default-site) on project test: Error generating maven-javadoc-plugin:3.2.0:test-aggregate-no-fork report:
> [ERROR] Exit code: 2 - javadoc: error - No source files for package de.yagee.test
> [ERROR]
> [ERROR] Command line was: /Users/yagee/Java/Home/14/bin/javadoc @options @packages
> [ERROR]
> [ERROR] Refer to the generated Javadoc files in '/Users/yagee/git/javadoc-test/target/site/testapidocs' dir.
> [ERROR] -> [Help 1]
>
> I can stick with 3.0.1 for a while, but of cause I want to move forward. I set up the minimal project to get this figured out, but I lost.
>
> Looking at https://maven.apache.org/plugins/maven-javadoc-plugin/usage.html, there is even no hint on suddenly requiring „compile“ starting with version 1.1.0. Still the site issue drives me nuts, too.
>
> Thanks again for helping me!
>
> kind regards,
>
> Thomas
>
> Am 27.10.2020 um 19:55 schrieb Benjamin Marwell <[hidden email]>:
>
> Hi Thomas,
>
> I tested your configuration and found the same issue – however, it may
> not be an issue after all.
>
> You configured your javadoc plugin as part of the reporting section.
> This usually requires the compile goal.
>
> Even if you add the jar goal to the default build->plugin section, it
> will still require compile to be executed. This is expected and
> documented in [2]:
> "Requires dependency resolution of artifacts in scope: compile. &&
> Binds by default to the lifecycle phase: package."
>
> Same description for the javadoc:javadoc goal.
>
> "mvn package site" will work because "package" includes the "compile"
> goal from the default lifecycle.
>
> site (on its own) however is it's own lifecycle and goal and does not
> contain the default's lifecycle compile goal. See [1].
>
> Everything you reported works as expected. From what I can tell it
> shouldn’t have worked with other java versions and/or other javadoc
> plugin versions either.
>
> Does this help you? If not, maybe you might want to explain your
> execution idea instead. This will help us getting an idea of what you
> are trying to achieve.
>
> Best regards,
> Ben
>
> [1] https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
> [2] https://maven.apache.org/plugins/maven-javadoc-plugin/jar-mojo.html
>
> Am Mo., 26. Okt. 2020 um 12:49 Uhr schrieb Thomas Scheffler
> <[hidden email]>:
>
>
> Hi,
>
> I have serious problems getting any maven-javadoc-plugin >= 3.1.0 to work with simply Java 11 test case:
>
> Neither will „mvn javadoc:javadoc“ nor „mvn javadoc:jar“ nor „mvn site“ work out-of-the-box. I have to add „compile“ in the middle to get the javadoc-plugin work but this will not fix the site generation.
>
> What’s wrong with the pom.xml or with maven (using version 3.6.3)?
>
> I created a small test project on github: https://github.com/yagee-de/javadoc-test
>
> The output I get is like:
>
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar (default-cli) on project test: MavenReportException: Error while generating Javadoc:
> [ERROR] Exit code: 1 - error: module not found: de.yagee.test
> [ERROR]
> [ERROR] Command line was: /Users/yagee/Java/Home/11/bin/javadoc @options @packages @argfile
> [ERROR]
> [ERROR] Refer to the generated Javadoc files in '/Users/yagee/git/javadoc-test/target/apidocs' dir.
> [ERROR]
> [ERROR] -> [Help 1]
>
> Any help is highly appreciated!
>
> Kind regards,
>
> Thomas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Java11 and javadoc plugin

Thomas Scheffler
Hi Benjamin,

you may have done something differently because „mvn test site“ does not work here. Could you recheck or give me a hint, what I could have done wrong?

kind regards,

Thomas

> Am 28.10.2020 um 20:05 schrieb Benjamin Marwell <[hidden email]>:
>
> Hi Thomas,
>
> no worry, that is as easy to fix as the previous one.
>
> Read carefully:
>> Error generating maven-javadoc-plugin:3.2.0:test-aggregate-no-fork
>
> The javadoc-plugin executes "test-aggregate-no-fork".
>
> Which means: It creates javadoc for your TEST classes from src/test/java.
> That again requires the "test" goal to be run first [1].
>> Requires dependency resolution of artifacts in scope: test.
>
> I rarely found it useful to generate, validate and publish javadoc for
> test classes.
>
> Long story short:
> mvn test site # (test includes compile).
>
> Although imho, you will always want to execute "mvn verify" (or "mvn
> clean verify") anyway, wouldn’t you? ;-)
> This is considered a good habit by Robert Scholte iirc.
>
> If you need more information on the "why", don’t hesitate to ask! :)
>
> [1] https://maven.apache.org/plugins/maven-javadoc-plugin/test-aggregate-no-fork-mojo.html
>
> Am Mi., 28. Okt. 2020 um 14:45 Uhr schrieb Thomas Scheffler
> <[hidden email]>:
>>
>> Hi,
>>
>> thanks for looking into it. I updated the project a bit so that you can easily switch the version with „-Djavadoc.plugin.version=3.0.1“ to see it working nice with „mvn site“ and „mvn javadoc:javadoc“. My problem is, that I don’t know how to make „site“ run again. „mvn compile site“ will prevent the errors for the main javadocs but will fail on test javadocs (Junit tests):
>>
>> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.9.1:site (default-site) on project test: Error generating maven-javadoc-plugin:3.2.0:test-aggregate-no-fork report:
>> [ERROR] Exit code: 2 - javadoc: error - No source files for package de.yagee.test
>> [ERROR]
>> [ERROR] Command line was: /Users/yagee/Java/Home/14/bin/javadoc @options @packages
>> [ERROR]
>> [ERROR] Refer to the generated Javadoc files in '/Users/yagee/git/javadoc-test/target/site/testapidocs' dir.
>> [ERROR] -> [Help 1]
>>
>> I can stick with 3.0.1 for a while, but of cause I want to move forward. I set up the minimal project to get this figured out, but I lost.
>>
>> Looking at https://maven.apache.org/plugins/maven-javadoc-plugin/usage.html, there is even no hint on suddenly requiring „compile“ starting with version 1.1.0. Still the site issue drives me nuts, too.
>>
>> Thanks again for helping me!
>>
>> kind regards,
>>
>> Thomas
>>
>> Am 27.10.2020 um 19:55 schrieb Benjamin Marwell <[hidden email]>:
>>
>> Hi Thomas,
>>
>> I tested your configuration and found the same issue – however, it may
>> not be an issue after all.
>>
>> You configured your javadoc plugin as part of the reporting section.
>> This usually requires the compile goal.
>>
>> Even if you add the jar goal to the default build->plugin section, it
>> will still require compile to be executed. This is expected and
>> documented in [2]:
>> "Requires dependency resolution of artifacts in scope: compile. &&
>> Binds by default to the lifecycle phase: package."
>>
>> Same description for the javadoc:javadoc goal.
>>
>> "mvn package site" will work because "package" includes the "compile"
>> goal from the default lifecycle.
>>
>> site (on its own) however is it's own lifecycle and goal and does not
>> contain the default's lifecycle compile goal. See [1].
>>
>> Everything you reported works as expected. From what I can tell it
>> shouldn’t have worked with other java versions and/or other javadoc
>> plugin versions either.
>>
>> Does this help you? If not, maybe you might want to explain your
>> execution idea instead. This will help us getting an idea of what you
>> are trying to achieve.
>>
>> Best regards,
>> Ben
>>
>> [1] https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
>> [2] https://maven.apache.org/plugins/maven-javadoc-plugin/jar-mojo.html
>>
>> Am Mo., 26. Okt. 2020 um 12:49 Uhr schrieb Thomas Scheffler
>> <[hidden email]>:
>>
>>
>> Hi,
>>
>> I have serious problems getting any maven-javadoc-plugin >= 3.1.0 to work with simply Java 11 test case:
>>
>> Neither will „mvn javadoc:javadoc“ nor „mvn javadoc:jar“ nor „mvn site“ work out-of-the-box. I have to add „compile“ in the middle to get the javadoc-plugin work but this will not fix the site generation.
>>
>> What’s wrong with the pom.xml or with maven (using version 3.6.3)?
>>
>> I created a small test project on github: https://github.com/yagee-de/javadoc-test
>>
>> The output I get is like:
>>
>> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar (default-cli) on project test: MavenReportException: Error while generating Javadoc:
>> [ERROR] Exit code: 1 - error: module not found: de.yagee.test
>> [ERROR]
>> [ERROR] Command line was: /Users/yagee/Java/Home/11/bin/javadoc @options @packages @argfile
>> [ERROR]
>> [ERROR] Refer to the generated Javadoc files in '/Users/yagee/git/javadoc-test/target/apidocs' dir.
>> [ERROR]
>> [ERROR] -> [Help 1]
>>
>> Any help is highly appreciated!
>>
>> Kind regards,
>>
>> Thomas
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Java11 and javadoc plugin

Benjamin Marwell-2
Hi Thomas,

| Exit code: 2 - javadoc: error - No source files for package de.yagee.test

You do not have a folder "/project/src/test/java" with any test sources!

I set up an example here:
https://github.com/FIUS/jvk/pull/123/files

Please be aware that you still cannot create test javadocs nor javadoc
from dependency sources. As said, please kindly create two issues for
this.

Am Do., 29. Okt. 2020 um 08:10 Uhr schrieb Thomas Scheffler
<[hidden email]>:

>
> Hi Benjamin,
>
> you may have done something differently because „mvn test site“ does not work here. Could you recheck or give me a hint, what I could have done wrong?
>
> kind regards,
>
> Thomas
>
> > Am 28.10.2020 um 20:05 schrieb Benjamin Marwell <[hidden email]>:
> >
> > Hi Thomas,
> >
> > no worry, that is as easy to fix as the previous one.
> >
> > Read carefully:
> >> Error generating maven-javadoc-plugin:3.2.0:test-aggregate-no-fork
> >
> > The javadoc-plugin executes "test-aggregate-no-fork".
> >
> > Which means: It creates javadoc for your TEST classes from src/test/java.
> > That again requires the "test" goal to be run first [1].
> >> Requires dependency resolution of artifacts in scope: test.
> >
> > I rarely found it useful to generate, validate and publish javadoc for
> > test classes.
> >
> > Long story short:
> > mvn test site # (test includes compile).
> >
> > Although imho, you will always want to execute "mvn verify" (or "mvn
> > clean verify") anyway, wouldn’t you? ;-)
> > This is considered a good habit by Robert Scholte iirc.
> >
> > If you need more information on the "why", don’t hesitate to ask! :)
> >
> > [1] https://maven.apache.org/plugins/maven-javadoc-plugin/test-aggregate-no-fork-mojo.html
> >
> > Am Mi., 28. Okt. 2020 um 14:45 Uhr schrieb Thomas Scheffler
> > <[hidden email]>:
> >>
> >> Hi,
> >>
> >> thanks for looking into it. I updated the project a bit so that you can easily switch the version with „-Djavadoc.plugin.version=3.0.1“ to see it working nice with „mvn site“ and „mvn javadoc:javadoc“. My problem is, that I don’t know how to make „site“ run again. „mvn compile site“ will prevent the errors for the main javadocs but will fail on test javadocs (Junit tests):
> >>
> >> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.9.1:site (default-site) on project test: Error generating maven-javadoc-plugin:3.2.0:test-aggregate-no-fork report:
> >> [ERROR] Exit code: 2 - javadoc: error - No source files for package de.yagee.test
> >> [ERROR]
> >> [ERROR] Command line was: /Users/yagee/Java/Home/14/bin/javadoc @options @packages
> >> [ERROR]
> >> [ERROR] Refer to the generated Javadoc files in '/Users/yagee/git/javadoc-test/target/site/testapidocs' dir.
> >> [ERROR] -> [Help 1]
> >>
> >> I can stick with 3.0.1 for a while, but of cause I want to move forward. I set up the minimal project to get this figured out, but I lost.
> >>
> >> Looking at https://maven.apache.org/plugins/maven-javadoc-plugin/usage.html, there is even no hint on suddenly requiring „compile“ starting with version 1.1.0. Still the site issue drives me nuts, too.
> >>
> >> Thanks again for helping me!
> >>
> >> kind regards,
> >>
> >> Thomas
> >>
> >> Am 27.10.2020 um 19:55 schrieb Benjamin Marwell <[hidden email]>:
> >>
> >> Hi Thomas,
> >>
> >> I tested your configuration and found the same issue – however, it may
> >> not be an issue after all.
> >>
> >> You configured your javadoc plugin as part of the reporting section.
> >> This usually requires the compile goal.
> >>
> >> Even if you add the jar goal to the default build->plugin section, it
> >> will still require compile to be executed. This is expected and
> >> documented in [2]:
> >> "Requires dependency resolution of artifacts in scope: compile. &&
> >> Binds by default to the lifecycle phase: package."
> >>
> >> Same description for the javadoc:javadoc goal.
> >>
> >> "mvn package site" will work because "package" includes the "compile"
> >> goal from the default lifecycle.
> >>
> >> site (on its own) however is it's own lifecycle and goal and does not
> >> contain the default's lifecycle compile goal. See [1].
> >>
> >> Everything you reported works as expected. From what I can tell it
> >> shouldn’t have worked with other java versions and/or other javadoc
> >> plugin versions either.
> >>
> >> Does this help you? If not, maybe you might want to explain your
> >> execution idea instead. This will help us getting an idea of what you
> >> are trying to achieve.
> >>
> >> Best regards,
> >> Ben
> >>
> >> [1] https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
> >> [2] https://maven.apache.org/plugins/maven-javadoc-plugin/jar-mojo.html
> >>
> >> Am Mo., 26. Okt. 2020 um 12:49 Uhr schrieb Thomas Scheffler
> >> <[hidden email]>:
> >>
> >>
> >> Hi,
> >>
> >> I have serious problems getting any maven-javadoc-plugin >= 3.1.0 to work with simply Java 11 test case:
> >>
> >> Neither will „mvn javadoc:javadoc“ nor „mvn javadoc:jar“ nor „mvn site“ work out-of-the-box. I have to add „compile“ in the middle to get the javadoc-plugin work but this will not fix the site generation.
> >>
> >> What’s wrong with the pom.xml or with maven (using version 3.6.3)?
> >>
> >> I created a small test project on github: https://github.com/yagee-de/javadoc-test
> >>
> >> The output I get is like:
> >>
> >> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar (default-cli) on project test: MavenReportException: Error while generating Javadoc:
> >> [ERROR] Exit code: 1 - error: module not found: de.yagee.test
> >> [ERROR]
> >> [ERROR] Command line was: /Users/yagee/Java/Home/11/bin/javadoc @options @packages @argfile
> >> [ERROR]
> >> [ERROR] Refer to the generated Javadoc files in '/Users/yagee/git/javadoc-test/target/apidocs' dir.
> >> [ERROR]
> >> [ERROR] -> [Help 1]
> >>
> >> Any help is highly appreciated!
> >>
> >> Kind regards,
> >>
> >> Thomas
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Java11 and javadoc plugin

Thomas Scheffler
Hi Benajmin,


Ironically „mvn javadoc:test-javadoc“ runs without any issues and without „test“ or „compile“ running before the „test-javadoc“ goal. No way to get it working during „mvn site“ though!

kind regards

Thomas

Am 29.10.2020 um 15:57 schrieb Benjamin Marwell <[hidden email]>:

Hi Thomas,

| Exit code: 2 - javadoc: error - No source files for package de.yagee.test

You do not have a folder "/project/src/test/java" with any test sources!

I set up an example here:
https://github.com/FIUS/jvk/pull/123/files

Please be aware that you still cannot create test javadocs nor javadoc
from dependency sources. As said, please kindly create two issues for
this.

Am Do., 29. Okt. 2020 um 08:10 Uhr schrieb Thomas Scheffler
<[hidden email]>:

Hi Benjamin,

you may have done something differently because „mvn test site“ does not work here. Could you recheck or give me a hint, what I could have done wrong?

kind regards,

Thomas

Am 28.10.2020 um 20:05 schrieb Benjamin Marwell <[hidden email]>:

Hi Thomas,

no worry, that is as easy to fix as the previous one.

Read carefully:
Error generating maven-javadoc-plugin:3.2.0:test-aggregate-no-fork

The javadoc-plugin executes "test-aggregate-no-fork".

Which means: It creates javadoc for your TEST classes from src/test/java.
That again requires the "test" goal to be run first [1].
Requires dependency resolution of artifacts in scope: test.

I rarely found it useful to generate, validate and publish javadoc for
test classes.

Long story short:
mvn test site # (test includes compile).

Although imho, you will always want to execute "mvn verify" (or "mvn
clean verify") anyway, wouldn’t you? ;-)
This is considered a good habit by Robert Scholte iirc.

If you need more information on the "why", don’t hesitate to ask! :)

[1] https://maven.apache.org/plugins/maven-javadoc-plugin/test-aggregate-no-fork-mojo.html

Am Mi., 28. Okt. 2020 um 14:45 Uhr schrieb Thomas Scheffler
<[hidden email]>:

Hi,

thanks for looking into it. I updated the project a bit so that you can easily switch the version with „-Djavadoc.plugin.version=3.0.1“ to see it working nice with „mvn site“ and „mvn javadoc:javadoc“. My problem is, that I don’t know how to make „site“ run again. „mvn compile site“ will prevent the errors for the main javadocs but will fail on test javadocs (Junit tests):

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.9.1:site (default-site) on project test: Error generating maven-javadoc-plugin:3.2.0:test-aggregate-no-fork report:
[ERROR] Exit code: 2 - javadoc: error - No source files for package de.yagee.test
[ERROR]
[ERROR] Command line was: /Users/yagee/Java/Home/14/bin/javadoc @options @packages
[ERROR]
[ERROR] Refer to the generated Javadoc files in '/Users/yagee/git/javadoc-test/target/site/testapidocs' dir.
[ERROR] -> [Help 1]

I can stick with 3.0.1 for a while, but of cause I want to move forward. I set up the minimal project to get this figured out, but I lost.

Looking at https://maven.apache.org/plugins/maven-javadoc-plugin/usage.html, there is even no hint on suddenly requiring „compile“ starting with version 1.1.0. Still the site issue drives me nuts, too.

Thanks again for helping me!

kind regards,

Thomas

Am 27.10.2020 um 19:55 schrieb Benjamin Marwell <[hidden email]>:

Hi Thomas,

I tested your configuration and found the same issue – however, it may
not be an issue after all.

You configured your javadoc plugin as part of the reporting section.
This usually requires the compile goal.

Even if you add the jar goal to the default build->plugin section, it
will still require compile to be executed. This is expected and
documented in [2]:
"Requires dependency resolution of artifacts in scope: compile. &&
Binds by default to the lifecycle phase: package."

Same description for the javadoc:javadoc goal.

"mvn package site" will work because "package" includes the "compile"
goal from the default lifecycle.

site (on its own) however is it's own lifecycle and goal and does not
contain the default's lifecycle compile goal. See [1].

Everything you reported works as expected. From what I can tell it
shouldn’t have worked with other java versions and/or other javadoc
plugin versions either.

Does this help you? If not, maybe you might want to explain your
execution idea instead. This will help us getting an idea of what you
are trying to achieve.

Best regards,
Ben

[1] https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
[2] https://maven.apache.org/plugins/maven-javadoc-plugin/jar-mojo.html

Am Mo., 26. Okt. 2020 um 12:49 Uhr schrieb Thomas Scheffler
<[hidden email]>:


Hi,

I have serious problems getting any maven-javadoc-plugin >= 3.1.0 to work with simply Java 11 test case:

Neither will „mvn javadoc:javadoc“ nor „mvn javadoc:jar“ nor „mvn site“ work out-of-the-box. I have to add „compile“ in the middle to get the javadoc-plugin work but this will not fix the site generation.

What’s wrong with the pom.xml or with maven (using version 3.6.3)?

I created a small test project on github: https://github.com/yagee-de/javadoc-test

The output I get is like:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar (default-cli) on project test: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - error: module not found: de.yagee.test
[ERROR]
[ERROR] Command line was: /Users/yagee/Java/Home/11/bin/javadoc @options @packages @argfile
[ERROR]
[ERROR] Refer to the generated Javadoc files in '/Users/yagee/git/javadoc-test/target/apidocs' dir.
[ERROR]
[ERROR] -> [Help 1]

Any help is highly appreciated!

Kind regards,

Thomas

smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Java11 and javadoc plugin

Benjamin Marwell-2
Hi Thomas,

Those test sources are neither in the project we talked about earlier, nor
do they have javadocs.

Let's keep focused on the project you mentioned earlier. Please take a look
at my explanations and the PR they resulted in.

The new project (https://github.com/yagee-de/javadoc-test/
<https://github.com/yagee-de/javadoc-test/tree/master/src/test/java/de/yagee/test>)
does not contain most of the pom.xml changes I suggested, eg setting some
plugin versions.

So, what is unclear in the PR I mentioned in the previous email? I'm happy
to help.

Ben

On Fri, 30 Oct 2020, 15:03 Thomas Scheffler, <[hidden email]>
wrote:

> Hi Benajmin,
>
> yes I have test sources present in that directory:
> https://github.com/yagee-de/javadoc-test/tree/master/src/test/java/de/yagee/test
>
> Ironically „mvn javadoc:test-javadoc“ runs without any issues and without
> „test“ or „compile“ running before the „test-javadoc“ goal. No way to get
> it working during „mvn site“ though!
>
> kind regards
>
> Thomas
>
> Am 29.10.2020 um 15:57 schrieb Benjamin Marwell <[hidden email]>:
>
> Hi Thomas,
>
> | Exit code: 2 - javadoc: error - No source files for package de.yagee.test
>
> You do not have a folder "/project/src/test/java" with any test sources!
>
> I set up an example here:
> https://github.com/FIUS/jvk/pull/123/files
>
> Please be aware that you still cannot create test javadocs nor javadoc
> from dependency sources. As said, please kindly create two issues for
> this.
>
> Am Do., 29. Okt. 2020 um 08:10 Uhr schrieb Thomas Scheffler
> <[hidden email]>:
>
>
> Hi Benjamin,
>
> you may have done something differently because „mvn test site“ does not
> work here. Could you recheck or give me a hint, what I could have done
> wrong?
>
> kind regards,
>
> Thomas
>
> Am 28.10.2020 um 20:05 schrieb Benjamin Marwell <[hidden email]>:
>
> Hi Thomas,
>
> no worry, that is as easy to fix as the previous one.
>
> Read carefully:
>
> Error generating maven-javadoc-plugin:3.2.0:test-aggregate-no-fork
>
>
> The javadoc-plugin executes "test-aggregate-no-fork".
>
> Which means: It creates javadoc for your TEST classes from src/test/java.
> That again requires the "test" goal to be run first [1].
>
> Requires dependency resolution of artifacts in scope: test.
>
>
> I rarely found it useful to generate, validate and publish javadoc for
> test classes.
>
> Long story short:
> mvn test site # (test includes compile).
>
> Although imho, you will always want to execute "mvn verify" (or "mvn
> clean verify") anyway, wouldn’t you? ;-)
> This is considered a good habit by Robert Scholte iirc.
>
> If you need more information on the "why", don’t hesitate to ask! :)
>
> [1]
> https://maven.apache.org/plugins/maven-javadoc-plugin/test-aggregate-no-fork-mojo.html
>
> Am Mi., 28. Okt. 2020 um 14:45 Uhr schrieb Thomas Scheffler
> <[hidden email]>:
>
>
> Hi,
>
> thanks for looking into it. I updated the project a bit so that you can
> easily switch the version with „-Djavadoc.plugin.version=3.0.1“ to see it
> working nice with „mvn site“ and „mvn javadoc:javadoc“. My problem is, that
> I don’t know how to make „site“ run again. „mvn compile site“ will prevent
> the errors for the main javadocs but will fail on test javadocs (Junit
> tests):
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-site-plugin:3.9.1:site (default-site) on
> project test: Error generating
> maven-javadoc-plugin:3.2.0:test-aggregate-no-fork report:
> [ERROR] Exit code: 2 - javadoc: error - No source files for package
> de.yagee.test
> [ERROR]
> [ERROR] Command line was: /Users/yagee/Java/Home/14/bin/javadoc @options
> @packages
> [ERROR]
> [ERROR] Refer to the generated Javadoc files in
> '/Users/yagee/git/javadoc-test/target/site/testapidocs' dir.
> [ERROR] -> [Help 1]
>
> I can stick with 3.0.1 for a while, but of cause I want to move forward. I
> set up the minimal project to get this figured out, but I lost.
>
> Looking at
> https://maven.apache.org/plugins/maven-javadoc-plugin/usage.html, there
> is even no hint on suddenly requiring „compile“ starting with version
> 1.1.0. Still the site issue drives me nuts, too.
>
> Thanks again for helping me!
>
> kind regards,
>
> Thomas
>
> Am 27.10.2020 um 19:55 schrieb Benjamin Marwell <[hidden email]>:
>
> Hi Thomas,
>
> I tested your configuration and found the same issue – however, it may
> not be an issue after all.
>
> You configured your javadoc plugin as part of the reporting section.
> This usually requires the compile goal.
>
> Even if you add the jar goal to the default build->plugin section, it
> will still require compile to be executed. This is expected and
> documented in [2]:
> "Requires dependency resolution of artifacts in scope: compile. &&
> Binds by default to the lifecycle phase: package."
>
> Same description for the javadoc:javadoc goal.
>
> "mvn package site" will work because "package" includes the "compile"
> goal from the default lifecycle.
>
> site (on its own) however is it's own lifecycle and goal and does not
> contain the default's lifecycle compile goal. See [1].
>
> Everything you reported works as expected. From what I can tell it
> shouldn’t have worked with other java versions and/or other javadoc
> plugin versions either.
>
> Does this help you? If not, maybe you might want to explain your
> execution idea instead. This will help us getting an idea of what you
> are trying to achieve.
>
> Best regards,
> Ben
>
> [1]
> https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
> [2] https://maven.apache.org/plugins/maven-javadoc-plugin/jar-mojo.html
>
> Am Mo., 26. Okt. 2020 um 12:49 Uhr schrieb Thomas Scheffler
> <[hidden email]>:
>
>
> Hi,
>
> I have serious problems getting any maven-javadoc-plugin >= 3.1.0 to work
> with simply Java 11 test case:
>
> Neither will „mvn javadoc:javadoc“ nor „mvn javadoc:jar“ nor „mvn site“
> work out-of-the-box. I have to add „compile“ in the middle to get the
> javadoc-plugin work but this will not fix the site generation.
>
> What’s wrong with the pom.xml or with maven (using version 3.6.3)?
>
> I created a small test project on github:
> https://github.com/yagee-de/javadoc-test
>
> The output I get is like:
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar (default-cli) on
> project test: MavenReportException: Error while generating Javadoc:
> [ERROR] Exit code: 1 - error: module not found: de.yagee.test
> [ERROR]
> [ERROR] Command line was: /Users/yagee/Java/Home/11/bin/javadoc @options
> @packages @argfile
> [ERROR]
> [ERROR] Refer to the generated Javadoc files in
> '/Users/yagee/git/javadoc-test/target/apidocs' dir.
> [ERROR]
> [ERROR] -> [Help 1]
>
> Any help is highly appreciated!
>
> Kind regards,
>
> Thomas
>
>