You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm sorry I don't understand the problem. You changed MyResource.java and it ran the target which is expected. What did it not do that you expected it to do?
When I run ant init I get A file has changed! /foo/bar/test-ant-watch/File.java and not A file has changed! /foo/bar/test-ant-watch/src/folder/File.java.
Apache Ant(TM) version 1.9.2 compiled on July 8 2013
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
Ok so the sub-directories under the directory you are watching aren't triggering the target? I can try and take a look at that. This going to be operating system sensitive. What OS are you using?
Activity
chubbard commentedon Jul 11, 2017
I'm sorry I don't understand the problem. You changed MyResource.java and it ran the target which is expected. What did it not do that you expected it to do?
cbou commentedon Jul 11, 2017
Please consider this setup:
build.xml:
When I run
ant initI getA file has changed! /foo/bar/test-ant-watch/File.javaand notA file has changed! /foo/bar/test-ant-watch/src/folder/File.java.chubbard commentedon Jul 14, 2017
Ok so the sub-directories under the directory you are watching aren't triggering the target? I can try and take a look at that. This going to be operating system sensitive. What OS are you using?
cbou commentedon Jul 15, 2017
Yes, I'm using macOS 10.12.5
cbou commentedon Jul 28, 2017
Did you had time to look at the issue? Do you have any tips where I can look at?
cbou commentedon Nov 4, 2018
You are using the WatchService and it does not do it work recursively by default.
This class could be used to watch directory and sub items: https://docs.oracle.com/javase/tutorial/essential/io/examples/WatchDir.java