You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2019/04/02 09:17:03 UTC

[Bug 63309] New: Javac should not require modulepath with source, and target < 9

https://bz.apache.org/bugzilla/show_bug.cgi?id=63309

            Bug ID: 63309
           Summary: Javac should not require modulepath with source, and
                    target < 9
           Product: Ant
           Version: 1.10.1
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
          Assignee: notifications@ant.apache.org
          Reporter: jochen@apache.org
  Target Milestone: ---

In a basic Jar project, with source=target=1.8, I am getting this message:

  either srcdir or modulesourcepath attribute must be set!

While this might make perfect sense with source=target=9, it is (at best)
surprising, and unnecessary in a 1.8 project.

What's worse: In the special case of modules, it is far from obvious what to
fill in here, at least without some knowledge of Java 9. (The error message
could help with that.)

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63309] Javac should not require modulepath with source, and target < 9

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63309

--- Comment #4 from Jochen Wiedmann <jo...@apache.org> ---
Okay, only I can't do that, AFAICT.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63309] Javac should not require modulepath with source, and target < 9

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63309

--- Comment #2 from Jochen Wiedmann <jo...@apache.org> ---
Okay, that works, if I am using the nested src element, or the srcdir
attribute. It doesn't with sourcepath, or sourcepathref, though. (Which may,
admittedly, be another problem.)

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63309] Javac should not require modulepath with source, and target < 9

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63309

--- Comment #3 from Stefan Bodewig <bo...@apache.org> ---
It is supposed to work with sourcepath and sourcepathref as well, so maybe we
just need to change this issue's subject :-)

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63309] Javac should not require modulepath with source, and target < 9

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63309

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Stefan Bodewig <bo...@apache.org> ---
You need to tell Ant where to find your sources. In a Java project prior to
Java 9 you specify srcdir and that's it. modulesourcepath is not required at
all.

Before we started to support modulesourcepath srcdir was required and the error
message has said so.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63309] Javac should not require modulepath with source, and target < 9

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63309

--- Comment #6 from Jochen Wiedmann <jo...@apache.org> ---
Not sure. I can confirm, that it used to work with srcdir, rather than
sourcepath, or sourcepathref, before. However, I recently had the need to add
another source directory.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63309] Javac should not require modulepath with source, and target < 9

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63309

--- Comment #5 from Stefan Bodewig <bo...@apache.org> ---
Not sure whether you could do it, but I've had a look at the code and I have
simply been wrong.

The sourceath(ref) attributes or nested sourcepath elements correspond to
javac's -sourcepath CLI arg. srcdir and the nested src element are there to
create filesets that Ant uses to find all the files you want to compile.
srcdir/src can not be replaced by sourcepath. My recollection has just been
wrong.

So your basic jar project should use srcdir or nested src element and should
never have used sourcepath at all. Has this worked with any older version of
Ant?

-- 
You are receiving this mail because:
You are the assignee for the bug.