Discussion:
[jira] [Created] (MJAVADOC-523) Exclude non-Java JARs from Maven Javadoc plugin processing
Thorsten Glaser (JIRA)
2018-04-13 19:10:00 UTC
Permalink
Thorsten Glaser created MJAVADOC-523:
----------------------------------------

Summary: Exclude non-Java JARs from Maven Javadoc plugin processing
Key: MJAVADOC-523
URL: https://issues.apache.org/jira/browse/MJAVADOC-523
Project: Maven Javadoc Plugin
Issue Type: Bug
Components: javadoc
Affects Versions: 2.8
Reporter: Thorsten Glaser


I have a multi-module project which builds a couple of JARs and then distributed them into two WARs.

However, one of the JARs does not contain any Java code at all, merely (maven-filtered) resources. This leads to warnings during the build like these:
{{[…]
[INFO] --- maven-javadoc-plugin:2.8:jar (attach-javadocs) @ foo-services ---
[INFO] The goal 'org.apache.maven.plugins:maven-javadoc-plugin:2.8:javadoc' has not been previously called for the module: 'de.tarent.foo:foo-rsrcs:jar:1.3.900-SNAPSHOT'. Trying to invoke it...

[WARNING] Creating fake javadoc directory to prevent repeated invocations: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs
[ERROR] Error fetching link: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs/package-list. Ignored it.

[INFO]
Loading source files for package de.tarent.foo.rest.transformation...
[…]}}
I found how I can exclude javadoc stuff by package, but not by artifact.

The plugin is currently included ONLY in the parent POM, like this:
{{<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-javadoc-plugin</artifactId><version>2.8</version><executions><execution><id>attach-javadocs</id><goals><goal>jar</goal></goals></execution></executions></plugin>}}
While it _is_ run during “compilation” of the resources-only JAR, it (obviously) produces no result, thus the warning (as it’s not excluded either).

How can I either make it produce something (i.e. the ability to create a valid-looking yet contentless FOO-javadoc.jar that satisfies references by reverse dependencies, in a JAR not containing any Java™ code) or, probably preferably, exclude the {{foo-rsrcs}} module from being accessed by mjavadoc on modules depending on it?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Thorsten Glaser (JIRA)
2018-04-13 19:13:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MJAVADOC-523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16437765#comment-16437765 ]

Thorsten Glaser commented on MJAVADOC-523:
------------------------------------------

Actually, I have *two* cases in which this occurs; one is a JAR without Java™ code, the other even has…

{{        <packaging>pom</packaging>}}

…so I cannot even use the workaround to add one dummy class into it.
Post by Thorsten Glaser (JIRA)
Exclude non-Java JARs from Maven Javadoc plugin processing
----------------------------------------------------------
Key: MJAVADOC-523
URL: https://issues.apache.org/jira/browse/MJAVADOC-523
Project: Maven Javadoc Plugin
Issue Type: Bug
Components: javadoc
Affects Versions: 2.8
Reporter: Thorsten Glaser
Priority: Minor
I have a multi-module project which builds a couple of JARs and then distributed them into two WARs.
{{[…]
[INFO] The goal 'org.apache.maven.plugins:maven-javadoc-plugin:2.8:javadoc' has not been previously called for the module: 'de.tarent.foo:foo-rsrcs:jar:1.3.900-SNAPSHOT'. Trying to invoke it...
[WARNING] Creating fake javadoc directory to prevent repeated invocations: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs
[ERROR] Error fetching link: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs/package-list. Ignored it.
[INFO]
Loading source files for package de.tarent.foo.rest.transformation...
[…]}}
I found how I can exclude javadoc stuff by package, but not by artifact.
{{<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-javadoc-plugin</artifactId><version>2.8</version><executions><execution><id>attach-javadocs</id><goals><goal>jar</goal></goals></execution></executions></plugin>}}
While it _is_ run during “compilation” of the resources-only JAR, it (obviously) produces no result, thus the warning (as it’s not excluded either).
How can I either make it produce something (i.e. the ability to create a valid-looking yet contentless FOO-javadoc.jar that satisfies references by reverse dependencies, in a JAR not containing any Java™ code) or, probably preferably, exclude the {{foo-rsrcs}} module from being accessed by mjavadoc on modules depending on it?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Rune Flobakk (JIRA)
2018-11-27 13:57:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MJAVADOC-523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16700452#comment-16700452 ]

Rune Flobakk commented on MJAVADOC-523:
---------------------------------------

I can make the warn go away using

{{<detectOfflineLinks>false</detectOfflineLinks>}}

(Found here: https://issues.jboss.org/browse/ISPN-8629)

I guess this works ok in my case because I have _only_ two modules, where one is not producing any javadocs.
Post by Thorsten Glaser (JIRA)
Exclude non-Java JARs from Maven Javadoc plugin processing
----------------------------------------------------------
Key: MJAVADOC-523
URL: https://issues.apache.org/jira/browse/MJAVADOC-523
Project: Maven Javadoc Plugin
Issue Type: Bug
Components: javadoc
Affects Versions: 2.8
Reporter: Thorsten Glaser
Priority: Minor
I have a multi-module project which builds a couple of JARs and then distributed them into two WARs.
{{[…]
[INFO] The goal 'org.apache.maven.plugins:maven-javadoc-plugin:2.8:javadoc' has not been previously called for the module: 'de.tarent.foo:foo-rsrcs:jar:1.3.900-SNAPSHOT'. Trying to invoke it...
[WARNING] Creating fake javadoc directory to prevent repeated invocations: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs
[ERROR] Error fetching link: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs/package-list. Ignored it.
[INFO]
Loading source files for package de.tarent.foo.rest.transformation...
[…]}}
I found how I can exclude javadoc stuff by package, but not by artifact.
{{<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-javadoc-plugin</artifactId><version>2.8</version><executions><execution><id>attach-javadocs</id><goals><goal>jar</goal></goals></execution></executions></plugin>}}
While it _is_ run during “compilation” of the resources-only JAR, it (obviously) produces no result, thus the warning (as it’s not excluded either).
How can I either make it produce something (i.e. the ability to create a valid-looking yet contentless FOO-javadoc.jar that satisfies references by reverse dependencies, in a JAR not containing any Java™ code) or, probably preferably, exclude the {{foo-rsrcs}} module from being accessed by mjavadoc on modules depending on it?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Thorsten Glaser (JIRA)
2018-11-27 17:20:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MJAVADOC-523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16700745#comment-16700745 ]

Thorsten Glaser commented on MJAVADOC-523:
------------------------------------------

Thanks for the workaround, it at least gets rid of several yellow and red lines in my Jenkins output, making it more manageable. I’d still prefer a proper fix of course, and I don’t know how this can negatively affect documentation.

Perhaps an invocation to build a dummy javadoc could be added to the non-Java modules, if the plugin supports such… it’s easy enough to run it after all. Even better would be if it could do that automatically, if invoked in a project without Java files, *and* skip attaching the dummy javadoc, use it only to satisfy resolution.
Post by Thorsten Glaser (JIRA)
Exclude non-Java JARs from Maven Javadoc plugin processing
----------------------------------------------------------
Key: MJAVADOC-523
URL: https://issues.apache.org/jira/browse/MJAVADOC-523
Project: Maven Javadoc Plugin
Issue Type: Bug
Components: javadoc
Affects Versions: 2.8
Reporter: Thorsten Glaser
Priority: Minor
I have a multi-module project which builds a couple of JARs and then distributed them into two WARs.
{{[…]
[INFO] The goal 'org.apache.maven.plugins:maven-javadoc-plugin:2.8:javadoc' has not been previously called for the module: 'de.tarent.foo:foo-rsrcs:jar:1.3.900-SNAPSHOT'. Trying to invoke it...
[WARNING] Creating fake javadoc directory to prevent repeated invocations: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs
[ERROR] Error fetching link: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs/package-list. Ignored it.
[INFO]
Loading source files for package de.tarent.foo.rest.transformation...
[…]}}
I found how I can exclude javadoc stuff by package, but not by artifact.
{{<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-javadoc-plugin</artifactId><version>2.8</version><executions><execution><id>attach-javadocs</id><goals><goal>jar</goal></goals></execution></executions></plugin>}}
While it _is_ run during “compilation” of the resources-only JAR, it (obviously) produces no result, thus the warning (as it’s not excluded either).
How can I either make it produce something (i.e. the ability to create a valid-looking yet contentless FOO-javadoc.jar that satisfies references by reverse dependencies, in a JAR not containing any Java™ code) or, probably preferably, exclude the {{foo-rsrcs}} module from being accessed by mjavadoc on modules depending on it?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Robert Scholte (JIRA)
2018-12-01 16:38:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MJAVADOC-523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Scholte updated MJAVADOC-523:
------------------------------------
Description:
I have a multi-module project which builds a couple of JARs and then distributed them into two WARs.

However, one of the JARs does not contain any Java code at all, merely (maven-filtered) resources. This leads to warnings during the build like these:
{noformat}[…]
[INFO] — maven-javadoc-plugin:2.8:jar (attach-javadocs) @ foo-services —
[INFO] The goal 'org.apache.maven.plugins:maven-javadoc-plugin:2.8:javadoc' has not been previously called for the module: 'de.tarent.foo:foo-rsrcs:jar:1.3.900-SNAPSHOT'. Trying to invoke it...

[WARNING] Creating fake javadoc directory to prevent repeated invocations: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs
[ERROR] Error fetching link: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs/package-list. Ignored it.

[INFO]
Loading source files for package de.tarent.foo.rest.transformation...
[…]{noformat}
I found how I can exclude javadoc stuff by package, but not by artifact.

The plugin is currently included ONLY in the parent POM, like this:
{code:xml}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
{code}
While it _is_ run during “compilation” of the resources-only JAR, it (obviously) produces no result, thus the warning (as it’s not excluded either).

How can I either make it produce something (i.e. the ability to create a valid-looking yet contentless FOO-javadoc.jar that satisfies references by reverse dependencies, in a JAR not containing any Java™ code) or, probably preferably, exclude the {{foo-rsrcs}} module from being accessed by mjavadoc on modules depending on it?

was:
I have a multi-module project which builds a couple of JARs and then distributed them into two WARs.

However, one of the JARs does not contain any Java code at all, merely (maven-filtered) resources. This leads to warnings during the build like these:
{{[…]
[INFO] --- maven-javadoc-plugin:2.8:jar (attach-javadocs) @ foo-services ---
[INFO] The goal 'org.apache.maven.plugins:maven-javadoc-plugin:2.8:javadoc' has not been previously called for the module: 'de.tarent.foo:foo-rsrcs:jar:1.3.900-SNAPSHOT'. Trying to invoke it...

[WARNING] Creating fake javadoc directory to prevent repeated invocations: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs
[ERROR] Error fetching link: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs/package-list. Ignored it.

[INFO]
Loading source files for package de.tarent.foo.rest.transformation...
[…]}}
I found how I can exclude javadoc stuff by package, but not by artifact.

The plugin is currently included ONLY in the parent POM, like this:
{{<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-javadoc-plugin</artifactId><version>2.8</version><executions><execution><id>attach-javadocs</id><goals><goal>jar</goal></goals></execution></executions></plugin>}}
While it _is_ run during “compilation” of the resources-only JAR, it (obviously) produces no result, thus the warning (as it’s not excluded either).

How can I either make it produce something (i.e. the ability to create a valid-looking yet contentless FOO-javadoc.jar that satisfies references by reverse dependencies, in a JAR not containing any Java™ code) or, probably preferably, exclude the {{foo-rsrcs}} module from being accessed by mjavadoc on modules depending on it?
Post by Thorsten Glaser (JIRA)
Exclude non-Java JARs from Maven Javadoc plugin processing
----------------------------------------------------------
Key: MJAVADOC-523
URL: https://issues.apache.org/jira/browse/MJAVADOC-523
Project: Maven Javadoc Plugin
Issue Type: Bug
Components: javadoc
Affects Versions: 2.8
Reporter: Thorsten Glaser
Priority: Minor
I have a multi-module project which builds a couple of JARs and then distributed them into two WARs.
{noformat}[…]
[INFO] The goal 'org.apache.maven.plugins:maven-javadoc-plugin:2.8:javadoc' has not been previously called for the module: 'de.tarent.foo:foo-rsrcs:jar:1.3.900-SNAPSHOT'. Trying to invoke it...
[WARNING] Creating fake javadoc directory to prevent repeated invocations: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs
[ERROR] Error fetching link: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs/package-list. Ignored it.
[INFO]
Loading source files for package de.tarent.foo.rest.transformation...
[…]{noformat}
I found how I can exclude javadoc stuff by package, but not by artifact.
{code:xml}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
{code}
While it _is_ run during “compilation” of the resources-only JAR, it (obviously) produces no result, thus the warning (as it’s not excluded either).
How can I either make it produce something (i.e. the ability to create a valid-looking yet contentless FOO-javadoc.jar that satisfies references by reverse dependencies, in a JAR not containing any Java™ code) or, probably preferably, exclude the {{foo-rsrcs}} module from being accessed by mjavadoc on modules depending on it?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Robert Scholte (JIRA)
2018-12-01 16:43:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MJAVADOC-523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Scholte closed MJAVADOC-523.
-----------------------------------
Resolution: Won't Fix
Assignee: Robert Scholte

Giving such a resources dependency the scope {{runtime}} should be sufficient to fix this issue. It will actually have better effects for other plugins too.
Post by Thorsten Glaser (JIRA)
Exclude non-Java JARs from Maven Javadoc plugin processing
----------------------------------------------------------
Key: MJAVADOC-523
URL: https://issues.apache.org/jira/browse/MJAVADOC-523
Project: Maven Javadoc Plugin
Issue Type: Bug
Components: javadoc
Affects Versions: 2.8
Reporter: Thorsten Glaser
Assignee: Robert Scholte
Priority: Minor
I have a multi-module project which builds a couple of JARs and then distributed them into two WARs.
{noformat}[…]
[INFO] The goal 'org.apache.maven.plugins:maven-javadoc-plugin:2.8:javadoc' has not been previously called for the module: 'de.tarent.foo:foo-rsrcs:jar:1.3.900-SNAPSHOT'. Trying to invoke it...
[WARNING] Creating fake javadoc directory to prevent repeated invocations: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs
[ERROR] Error fetching link: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs/package-list. Ignored it.
[INFO]
Loading source files for package de.tarent.foo.rest.transformation...
[…]{noformat}
I found how I can exclude javadoc stuff by package, but not by artifact.
{code:xml}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
{code}
While it _is_ run during “compilation” of the resources-only JAR, it (obviously) produces no result, thus the warning (as it’s not excluded either).
How can I either make it produce something (i.e. the ability to create a valid-looking yet contentless FOO-javadoc.jar that satisfies references by reverse dependencies, in a JAR not containing any Java™ code) or, probably preferably, exclude the {{foo-rsrcs}} module from being accessed by mjavadoc on modules depending on it?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Thorsten Glaser (JIRA)
2018-12-01 19:26:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MJAVADOC-523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16705967#comment-16705967 ]

Thorsten Glaser commented on MJAVADOC-523:
------------------------------------------

Please reopen!

{color:#FF0000}This is a *compile-time* dependency, *not* a run-time resource{color}. It is actually baked into the WAR because parts of the backend operation use it, and for this, we need it available during the compile phase (package is too late).
Post by Thorsten Glaser (JIRA)
Exclude non-Java JARs from Maven Javadoc plugin processing
----------------------------------------------------------
Key: MJAVADOC-523
URL: https://issues.apache.org/jira/browse/MJAVADOC-523
Project: Maven Javadoc Plugin
Issue Type: Bug
Components: javadoc
Affects Versions: 2.8
Reporter: Thorsten Glaser
Assignee: Robert Scholte
Priority: Minor
I have a multi-module project which builds a couple of JARs and then distributed them into two WARs.
{noformat}[…]
[INFO] The goal 'org.apache.maven.plugins:maven-javadoc-plugin:2.8:javadoc' has not been previously called for the module: 'de.tarent.foo:foo-rsrcs:jar:1.3.900-SNAPSHOT'. Trying to invoke it...
[WARNING] Creating fake javadoc directory to prevent repeated invocations: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs
[ERROR] Error fetching link: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs/package-list. Ignored it.
[INFO]
Loading source files for package de.tarent.foo.rest.transformation...
[…]{noformat}
I found how I can exclude javadoc stuff by package, but not by artifact.
{code:xml}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
{code}
While it _is_ run during “compilation” of the resources-only JAR, it (obviously) produces no result, thus the warning (as it’s not excluded either).
How can I either make it produce something (i.e. the ability to create a valid-looking yet contentless FOO-javadoc.jar that satisfies references by reverse dependencies, in a JAR not containing any Java™ code) or, probably preferably, exclude the {{foo-rsrcs}} module from being accessed by mjavadoc on modules depending on it?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Robert Scholte (JIRA)
2018-12-01 19:29:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/MJAVADOC-523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16705968#comment-16705968 ]

Robert Scholte commented on MJAVADOC-523:
-----------------------------------------

Please provide a project to reproduce
Post by Thorsten Glaser (JIRA)
Exclude non-Java JARs from Maven Javadoc plugin processing
----------------------------------------------------------
Key: MJAVADOC-523
URL: https://issues.apache.org/jira/browse/MJAVADOC-523
Project: Maven Javadoc Plugin
Issue Type: Bug
Components: javadoc
Affects Versions: 2.8
Reporter: Thorsten Glaser
Assignee: Robert Scholte
Priority: Minor
I have a multi-module project which builds a couple of JARs and then distributed them into two WARs.
{noformat}[…]
[INFO] The goal 'org.apache.maven.plugins:maven-javadoc-plugin:2.8:javadoc' has not been previously called for the module: 'de.tarent.foo:foo-rsrcs:jar:1.3.900-SNAPSHOT'. Trying to invoke it...
[WARNING] Creating fake javadoc directory to prevent repeated invocations: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs
[ERROR] Error fetching link: /var/lib/jenkins/jobs/FooTool/workspace/foo-backend/foo-rsrcs/target/apidocs/package-list. Ignored it.
[INFO]
Loading source files for package de.tarent.foo.rest.transformation...
[…]{noformat}
I found how I can exclude javadoc stuff by package, but not by artifact.
{code:xml}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
{code}
While it _is_ run during “compilation” of the resources-only JAR, it (obviously) produces no result, thus the warning (as it’s not excluded either).
How can I either make it produce something (i.e. the ability to create a valid-looking yet contentless FOO-javadoc.jar that satisfies references by reverse dependencies, in a JAR not containing any Java™ code) or, probably preferably, exclude the {{foo-rsrcs}} module from being accessed by mjavadoc on modules depending on it?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Loading...