Comments (3)
I haven't isolated at what point it changed, but I have done some preliminary investigation into the cause:
In the file: WatchServiceRegistar.java in the method watch:
void watch(FileSystemSubset fileSystemSubset) throws IOException {
lock.lock();
try {
LOG.debug("Begin - adding watches for {}", fileSystemSubset);
final WatchPointsRegistry.Delta delta =
watchPointsRegistry.appendFileSystemSubset(fileSystemSubset, getCurrentWatchPoints());
Iterable<? extends File> startingWatchPoints = delta.getStartingWatchPoints();
This method gets called twice. The first time to start the watching of src/main/java, which is added by the JavaPlugin, which is added by WarPlugin.java. In this all the src/main/webapp is rejected in the FileWalker, defined within the watch method:
Files.walkFileTree(dirPath, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attrs) throws IOException {
if (!path.equals(dirPath)) {
if (delta.shouldWatch(path.toFile())) {
watchDir(path);
return FileVisitResult.CONTINUE;
} else {
LOG.debug("Skipping watching for {}, filtered by WatchPointsRegistry", path);
return FileVisitResult.SKIP_SUBTREE;
}
} else {
return FileVisitResult.CONTINUE;
}
});
The call to the delta.shouldWatch is rejected because src/main/webapp is not a child of src/main/java.
In the second pass, a new Delta is created with the following parameters:
fileSystemSubset: with files = $projectDir/topLevel and tree=$projectDIr/src/main/webapp
getCurrentWatchPoints() = {$projectDir/src/main, $projectDir}
when calling the delta.getStartingWatchPoints(), the starting points only contains: $projectDir.
In the for loop that iterates over the starting points, src/main/webapp is skipped because the entire src dir is skipped. This is because the src/main/webapp is defined as a root within the delta. As a result, no watchpoint is ever registered because the delta.shouldWatch() returns false for the src directory and prevents the rest of the subtree from being registered.
I'm not sure what the correct way to resolve this.
from gradle.
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.
from gradle.
This issue has been automatically closed due to inactivity. If you can reproduce this on a recent version of Gradle or if you have a good use case for this feature, please feel free to reopen the issue with steps to reproduce, a quick explanation of your use case or a high-quality pull request.
from gradle.
Related Issues (20)
- CachingTaskInputFileCollection loose relative path sensitivity
- Create release notes for the new Java compiler integration with the Problems API
- Wrong information about removing unintentional subprojects HOT 3
- Formatting should be the same with JDK8 compiler reports as with other compilers HOT 1
- Allow configurations to be safely resolved from outside of owning scope HOT 1
- Gradle 7+ "force" changes cause a different resolution behavior HOT 3
- Deprecate running Gradle on JVM versions < 17
- Add mechanism for different package managers to contribute their installed JVM toolchains HOT 2
- Task dependency inference doesn't work for named domain object containers HOT 1
- Idea plugin is not IP compatible when configured directly
- `unreportedProblemInCurrentCall` error when using configure action
- Allow Configuration Cache for TAPI requests without Isolated Projects HOT 1
- Problem description copied from the CC report is noisy and ill-formatted HOT 2
- Let providers handle task and transform dependencies uniformly everywhere
- API for adding LICENSE.txt file to published JAR (and other artifacts) HOT 3
- Simple custom interceptors for bytecode upgrade don't allow to upgrade any type
- Gradle build fails with an error on sync with Configuration Cache
- GradleRunner race condition: Cannot access input property 'sources' of task HOT 1
- Use configuration names in `AbstractDependencyReportTask` HOT 3
- Gradle 8.8 causing Java crashes on older macOS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle.