You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Gintautas Grigelionis <g....@gmail.com> on 2018/01/19 20:19:20 UTC

Generating Ant javadoc with Java 9 fails

Constructing Javadoc information...
...../ant/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java:35:
error: package javax.activation is not visible
import javax.activation.DataHandler;
            ^
  (package javax.activation is declared in module java.activation, which is
not in the module graph)
...../ant/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java:36:
error: package javax.activation is not visible
import javax.activation.FileDataSource;
            ^
  (package javax.activation is declared in module java.activation, which is
not in the module graph)
...../ant/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java:76:
error: package javax.activation is not visible
    class StringDataSource implements javax.activation.DataSource {
                                           ^
  (package javax.activation is declared in module java.activation, which is
not in the module graph)
3 errors

Has anybody looked into this?

Gintas

Re: Generating Ant javadoc with Java 9 fails

Posted by Gintautas Grigelionis <g....@gmail.com>.
> > <arg line="--add-modules java.activation"/>
>
> > inside <javadoc> does the trick, but then it has to be conditional for
> > Java 9, at least until a new version of javax.mail-api that pulls in a
> > JEE JAF implementation is available.
>
> > Should I activate an if/else namespace in the buildfile and add a new
> > property checking for Java 9 to, say, check-javadoc?
>
> There already is jdk9+ which gets set in check-optional-packages
>

That led me to rearranging of dependencies between targets; pity that <arg>
does not understand if...


> Not being able to resolve a class a javodc comment links used to be no
> error but only a warning, so I am stubborn and consider the problem a
> warning. :-)
>
> > I guess something similar must be done in POMs?
>
> No idea. You'd probably have to fiddle with profiles, then. Do we really
> want to invest time in making the POMs suitable for building javadocs?
> To me their only purpose is to be useful together with jars we publish
> to Maven central. I know they can be used to build and test the parts in
> question but that's not really something that is important IMHO.
>

I want Maven to work not the least because I want to get rid of "root"
property hack that makes unit tests so much more complex (which was
introduced due to limitations in ancient Surefire).

Gintas

Re: Generating Ant javadoc with Java 9 fails

Posted by Stefan Bodewig <bo...@apache.org>.
On 2018-01-20, Gintautas Grigelionis wrote:

> <arg line="--add-modules java.activation"/>

> inside <javadoc> does the trick, but then it has to be conditional for
> Java 9, at least until a new version of javax.mail-api that pulls in a
> JEE JAF implementation is available.

> Should I activate an if/else namespace in the buildfile and add a new
> property checking for Java 9 to, say, check-javadoc?

There already is jdk9+ which gets set in check-optional-packages

Not being able to resolve a class a javodc comment links used to be no
error but only a warning, so I am stubborn and consider the problem a
warning. :-)

> I guess something similar must be done in POMs?

No idea. You'd probably have to fiddle with profiles, then. Do we really
want to invest time in making the POMs suitable for building javadocs?
To me their only purpose is to be useful together with jars we publish
to Maven central. I know they can be used to build and test the parts in
question but that's not really something that is important IMHO.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Generating Ant javadoc with Java 9 fails

Posted by Gintautas Grigelionis <g....@gmail.com>.
<arg line="--add-modules java.activation"/>

inside <javadoc> does the trick, but then it has to be conditional for
Java 9, at least until a new version of javax.mail-api that pulls in a
JEE JAF implementation is available.

Should I activate an if/else namespace in the buildfile and add a new
property checking for Java 9 to, say, check-javadoc? I guess something
similar must be done in POMs?

Gintas


2018-01-20 20:21 GMT+01:00 Gintautas Grigelionis <g....@gmail.com>:

> To pick the nit, it's an error :-( Anyway, I'll try to see what's
> available for javadoc in Java 9.
>
> Gintas
>
>
> 2018-01-20 19:23 GMT+01:00 Stefan Bodewig <bo...@apache.org>:
>
>> On 2018-01-20, Gintautas Grigelionis wrote:
>>
>> > The problem is that JAF is leaving JRE again for JEE (or whatever it's
>> > called now). According to Stackoverflow[1], it will be gone in Java 11.
>> > I'm not quite sure what solution is best.
>>
>> Trying to silence the warning altogether ;-)
>>
>> Stefan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> For additional commands, e-mail: dev-help@ant.apache.org
>>
>>
>

Re: Generating Ant javadoc with Java 9 fails

Posted by Gintautas Grigelionis <g....@gmail.com>.
To pick the nit, it's an error :-( Anyway, I'll try to see what's available
for javadoc in Java 9.

Gintas

2018-01-20 19:23 GMT+01:00 Stefan Bodewig <bo...@apache.org>:

> On 2018-01-20, Gintautas Grigelionis wrote:
>
> > The problem is that JAF is leaving JRE again for JEE (or whatever it's
> > called now). According to Stackoverflow[1], it will be gone in Java 11.
> > I'm not quite sure what solution is best.
>
> Trying to silence the warning altogether ;-)
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

Re: Generating Ant javadoc with Java 9 fails

Posted by Stefan Bodewig <bo...@apache.org>.
On 2018-01-20, Gintautas Grigelionis wrote:

> The problem is that JAF is leaving JRE again for JEE (or whatever it's
> called now). According to Stackoverflow[1], it will be gone in Java 11.
> I'm not quite sure what solution is best.

Trying to silence the warning altogether ;-)

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Generating Ant javadoc with Java 9 fails

Posted by Gintautas Grigelionis <g....@gmail.com>.
The problem is that JAF is leaving JRE again for JEE (or whatever it's
called now). According to Stackoverflow[1], it will be gone in Java 11.
I'm not quite sure what solution is best.

Gintas

[1]
https://stackoverflow.com/questions/46493613/what-is-the-replacement-for-javax-activation-package-in-java-9

2018-01-20 18:01 GMT+01:00 Stefan Bodewig <bo...@apache.org>:

> On 2018-01-19, Gintautas Grigelionis wrote:
>
> >   (package javax.activation is declared in module java.activation, which
> is
> > not in the module graph)
>
> Is there an option to suppress the warning?
>
> Fixing that may force us to explicitly start using module paths inside
> of the build file together with conditional builds for Java 9. I'd try
> to avoid that.
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

Re: Generating Ant javadoc with Java 9 fails

Posted by Stefan Bodewig <bo...@apache.org>.
On 2018-01-19, Gintautas Grigelionis wrote:

>   (package javax.activation is declared in module java.activation, which is
> not in the module graph)

Is there an option to suppress the warning?

Fixing that may force us to explicitly start using module paths inside
of the build file together with conditional builds for Java 9. I'd try
to avoid that.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org