javadoc:jar and generated sources

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

javadoc:jar and generated sources

ljnelson
I am finding that the sourcepath for javadoc:jar (when run as part of the
release profile) is different from the sourcepath for javadoc:javadoc in my
project that involves (protoc-) generated sources.

(The net effect is that at release time, everything works fine up until
release:perform, which fails (!) during the attach-javadocs execution I've
configured following the documentation (
https://maven.apache.org/plugin-developers/cookbook/attach-source-javadoc-artifacts.html#Configuring_Maven_Javadoc_Plugin)
).

I have a <pluginManagement> stanza centralizing my maven-javadoc-plugin
configuration that does not mention sourcepath in any way.

mvn help:effective-pom -Prelease shows exactly what I would expect, and no
additional maven-javadoc-plugin configuration.

Somehow, the sourcepath for javadoc:javadoc has the generated-sources
directory in it; the sourcepath for javadoc:jar does not.

Here is the pluginManagement section (it's quite ordinary):

<plugin>
  <artifactId>maven-javadoc-plugin</artifactId>
  <version>3.0.0-M1</version>
  <configuration>
    <doclint>-missing</doclint>
  </configuration>
</plugin>

When I run mvn -X javadoc:javadoc and inspect the options file, I see this:

-sourcepath
'/Users/ljnelson/Projects/frob/src/main/java:
*/Users/ljnelson/Projects/frob/target/generated-sources/protobuf/java:/Users/ljnelson/Projects/frob/target/generated-sources/protobuf/grpc-java*
:/Users/ljnelson/Projects/frob/src/main/javadoc'

When I run mvn -X javadoc:jar and inspect the options file, I see only this:

-sourcepath
'/Users/ljnelson/Projects/frob/src/main/java:/Users/ljnelson/Projects/frob/src/main/javadoc'

The javadoc:jar goal outputs a bunch of warnings.  When I run it locally
(mvn javadoc:jar), they show up as warnings.  When it is run as part of the
maven-release-plugin's perform goal, it fails the build.

I'm at a loss as to how to go about fixing this.  Is it, perhaps, the job
of the plugin in charge of generating the sources to do something here?

Best,
Laird
Reply | Threaded
Open this post in threaded view
|

Re: javadoc:jar and generated sources

Maxim Solodovnik
I can confirm this :(
Spent several hours trying to release
Finaly fixed all javadoc warnings ....

WBR, Maxim
(from mobile, sorry for the typos)

On Wed, Mar 14, 2018, 00:57 Laird Nelson <[hidden email]> wrote:

> I am finding that the sourcepath for javadoc:jar (when run as part of the
> release profile) is different from the sourcepath for javadoc:javadoc in my
> project that involves (protoc-) generated sources.
>
> (The net effect is that at release time, everything works fine up until
> release:perform, which fails (!) during the attach-javadocs execution I've
> configured following the documentation (
>
> https://maven.apache.org/plugin-developers/cookbook/attach-source-javadoc-artifacts.html#Configuring_Maven_Javadoc_Plugin
> )
> ).
>
> I have a <pluginManagement> stanza centralizing my maven-javadoc-plugin
> configuration that does not mention sourcepath in any way.
>
> mvn help:effective-pom -Prelease shows exactly what I would expect, and no
> additional maven-javadoc-plugin configuration.
>
> Somehow, the sourcepath for javadoc:javadoc has the generated-sources
> directory in it; the sourcepath for javadoc:jar does not.
>
> Here is the pluginManagement section (it's quite ordinary):
>
> <plugin>
>   <artifactId>maven-javadoc-plugin</artifactId>
>   <version>3.0.0-M1</version>
>   <configuration>
>     <doclint>-missing</doclint>
>   </configuration>
> </plugin>
>
> When I run mvn -X javadoc:javadoc and inspect the options file, I see this:
>
> -sourcepath
> '/Users/ljnelson/Projects/frob/src/main/java:
>
> */Users/ljnelson/Projects/frob/target/generated-sources/protobuf/java:/Users/ljnelson/Projects/frob/target/generated-sources/protobuf/grpc-java*
> :/Users/ljnelson/Projects/frob/src/main/javadoc'
>
> When I run mvn -X javadoc:jar and inspect the options file, I see only
> this:
>
> -sourcepath
>
> '/Users/ljnelson/Projects/frob/src/main/java:/Users/ljnelson/Projects/frob/src/main/javadoc'
>
> The javadoc:jar goal outputs a bunch of warnings.  When I run it locally
> (mvn javadoc:jar), they show up as warnings.  When it is run as part of the
> maven-release-plugin's perform goal, it fails the build.
>
> I'm at a loss as to how to go about fixing this.  Is it, perhaps, the job
> of the plugin in charge of generating the sources to do something here?
>
> Best,
> Laird
>
Reply | Threaded
Open this post in threaded view
|

Re: javadoc:jar and generated sources

Hervé BOUTEMY
In reply to this post by ljnelson
strange

can you provide a test project, please?

Regards,

Hervé

Le mardi 13 mars 2018, 18:56:45 CET Laird Nelson a écrit :

> I am finding that the sourcepath for javadoc:jar (when run as part of the
> release profile) is different from the sourcepath for javadoc:javadoc in my
> project that involves (protoc-) generated sources.
>
> (The net effect is that at release time, everything works fine up until
> release:perform, which fails (!) during the attach-javadocs execution I've
> configured following the documentation (
> https://maven.apache.org/plugin-developers/cookbook/attach-source-javadoc-ar
> tifacts.html#Configuring_Maven_Javadoc_Plugin) ).
>
> I have a <pluginManagement> stanza centralizing my maven-javadoc-plugin
> configuration that does not mention sourcepath in any way.
>
> mvn help:effective-pom -Prelease shows exactly what I would expect, and no
> additional maven-javadoc-plugin configuration.
>
> Somehow, the sourcepath for javadoc:javadoc has the generated-sources
> directory in it; the sourcepath for javadoc:jar does not.
>
> Here is the pluginManagement section (it's quite ordinary):
>
> <plugin>
>   <artifactId>maven-javadoc-plugin</artifactId>
>   <version>3.0.0-M1</version>
>   <configuration>
>     <doclint>-missing</doclint>
>   </configuration>
> </plugin>
>
> When I run mvn -X javadoc:javadoc and inspect the options file, I see this:
>
> -sourcepath
> '/Users/ljnelson/Projects/frob/src/main/java:
> */Users/ljnelson/Projects/frob/target/generated-sources/protobuf/java:/Users
> /ljnelson/Projects/frob/target/generated-sources/protobuf/grpc-java*
> :/Users/ljnelson/Projects/frob/src/main/javadoc'
>
> When I run mvn -X javadoc:jar and inspect the options file, I see only this:
>
> -sourcepath
> '/Users/ljnelson/Projects/frob/src/main/java:/Users/ljnelson/Projects/frob/s
> rc/main/javadoc'
>
> The javadoc:jar goal outputs a bunch of warnings.  When I run it locally
> (mvn javadoc:jar), they show up as warnings.  When it is run as part of the
> maven-release-plugin's perform goal, it fails the build.
>
> I'm at a loss as to how to go about fixing this.  Is it, perhaps, the job
> of the plugin in charge of generating the sources to do something here?
>
> Best,
> Laird



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

Reply | Threaded
Open this post in threaded view
|

Re: javadoc:jar and generated sources

Thomas Broyer-2
In reply to this post by ljnelson
Be careful in your testing: javadoc:javadoc forks a lifecycle at
'generate-sources' phase (and javadoc:aggregate at 'compile' phase),
whereas javadoc:jar does not!
So running 'mvn javadoc:jar' alone indeed won't run your protoc plugin,
which won't add the generated sources as a compile source root. Running
'mvn generate-sources javadoc:jar' would work differently; and obviously
binding javadoc:jar to a phase in your build (after generate-sources phase,
default  being 'package') and running 'mvn package' should then work the
same.

Le mar. 13 mars 2018 18:57, Laird Nelson <[hidden email]> a écrit :

> I am finding that the sourcepath for javadoc:jar (when run as part of the
> release profile) is different from the sourcepath for javadoc:javadoc in my
> project that involves (protoc-) generated sources.
>
> (The net effect is that at release time, everything works fine up until
> release:perform, which fails (!) during the attach-javadocs execution I've
> configured following the documentation (
>
> https://maven.apache.org/plugin-developers/cookbook/attach-source-javadoc-artifacts.html#Configuring_Maven_Javadoc_Plugin
> )
> ).
>
> I have a <pluginManagement> stanza centralizing my maven-javadoc-plugin
> configuration that does not mention sourcepath in any way.
>
> mvn help:effective-pom -Prelease shows exactly what I would expect, and no
> additional maven-javadoc-plugin configuration.
>
> Somehow, the sourcepath for javadoc:javadoc has the generated-sources
> directory in it; the sourcepath for javadoc:jar does not.
>
> Here is the pluginManagement section (it's quite ordinary):
>
> <plugin>
>   <artifactId>maven-javadoc-plugin</artifactId>
>   <version>3.0.0-M1</version>
>   <configuration>
>     <doclint>-missing</doclint>
>   </configuration>
> </plugin>
>
> When I run mvn -X javadoc:javadoc and inspect the options file, I see this:
>
> -sourcepath
> '/Users/ljnelson/Projects/frob/src/main/java:
>
> */Users/ljnelson/Projects/frob/target/generated-sources/protobuf/java:/Users/ljnelson/Projects/frob/target/generated-sources/protobuf/grpc-java*
> :/Users/ljnelson/Projects/frob/src/main/javadoc'
>
> When I run mvn -X javadoc:jar and inspect the options file, I see only
> this:
>
> -sourcepath
>
> '/Users/ljnelson/Projects/frob/src/main/java:/Users/ljnelson/Projects/frob/src/main/javadoc'
>
> The javadoc:jar goal outputs a bunch of warnings.  When I run it locally
> (mvn javadoc:jar), they show up as warnings.  When it is run as part of the
> maven-release-plugin's perform goal, it fails the build.
>
> I'm at a loss as to how to go about fixing this.  Is it, perhaps, the job
> of the plugin in charge of generating the sources to do something here?
>
> Best,
> Laird
>
Reply | Threaded
Open this post in threaded view
|

Re: javadoc:jar and generated sources

ljnelson
On Thu, Mar 15, 2018 at 1:38 AM Thomas Broyer <[hidden email]> wrote:

> Be careful in your testing: javadoc:javadoc forks a lifecycle at
> 'generate-sources' phase (and javadoc:aggregate at 'compile' phase),
> whereas javadoc:jar does not!
>

An excellent point.


> So running 'mvn javadoc:jar' alone indeed won't run your protoc plugin,
> which won't add the generated sources as a compile source root.


OK, so that's the explanation for my debugging session.

Best,
Laird
Reply | Threaded
Open this post in threaded view
|

Re: javadoc:jar and generated sources

Mirko Friedenhagen-2
Hello there,

one other idea:
* see https://maven.apache.org/pom.html#The_Super_POM
* release:perform activates the release-profile
* inside of the release-profile an execution attach-sources is
defined, which maybe does not inherit your configuration?

Regards
Mirko
Regards Mirko
--
http://illegalstateexception.blogspot.com/
https://github.com/mfriedenhagen/
https://bitbucket.org/mfriedenhagen/


On Thu, Mar 15, 2018 at 7:11 PM, Laird Nelson <[hidden email]> wrote:

> On Thu, Mar 15, 2018 at 1:38 AM Thomas Broyer <[hidden email]> wrote:
>
>> Be careful in your testing: javadoc:javadoc forks a lifecycle at
>> 'generate-sources' phase (and javadoc:aggregate at 'compile' phase),
>> whereas javadoc:jar does not!
>>
>
> An excellent point.
>
>
>> So running 'mvn javadoc:jar' alone indeed won't run your protoc plugin,
>> which won't add the generated sources as a compile source root.
>
>
> OK, so that's the explanation for my debugging session.
>
> Best,
> Laird

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