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)
- buildSrc and buildSrc-like included builds spin up Kotlin daemon that for the most users used only once HOT 3
- Expose a more convenient API to access both the dependency graph and associated files HOT 1
- `@OutputFile`-annotated `Provider<RegularFile>` should carry task dependency for all provider implementations HOT 1
- Property.replace is gone from 8.8 RC2 HOT 1
- Deprecate property setters that accept `Object` in Gradle 8.x
- Circular dependency in project with nested shared subproject. HOT 1
- `@OptionValues` annotation doesn't support lazy values as a return type
- Lazier MavenPublication pom configuration HOT 1
- Maven artifact version catalogs do not support snapshot versions HOT 2
- Mention `:configuration-cache` types moving to `internal` package in the upgrade guide
- Auto-detection of installed toolchains by mise
- Consider Setting Console CP to UTF-8 on Windows to enable UTF-8 Console Output HOT 1
- Explain how test suites can access test fixtures
- Add Provider.orElse(Callable) HOT 1
- support test fixtures per test suite HOT 2
- Simplify writing custom interceptors for upgraded properties HOT 2
- Configuration cache: Cannot set the value of a property of type [...].Configuration using a provider of type [...].DefaultFileCollectionFactory$ResolvingFileCollection HOT 2
- If local distribution zip was modified, use updated distribution contents HOT 4
- I can see module and gradle is configured to add the gradle module metadata HOT 1
- Gradle classes leak into compilation when no dependencies declared
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.