Conversation
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
| // This default implementation resolves paths relative to the current working directory. | ||
| // Custom implementations (e.g., IDE integrations) should override this method | ||
| // to resolve against the actual build context basedir. | ||
| return java.nio.file.Paths.get(relpath); |
There was a problem hiding this comment.
We should use LegacySupport here to get the current maven project and return the basedir then.
There was a problem hiding this comment.
Updated to use LegacySupport to get the current Maven project and resolve paths against the project basedir. Falls back to current working directory if project is not available. See commit 495f4ad.
laeubi
left a comment
There was a problem hiding this comment.
@copilot see comment we likely need to add a new dependency for org.apache.maven.plugin.LegacySupport (scope provided)
Also the readme needs to be updated to mention the new API
… and update README Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
The maven-core dependency (scope provided) already exists in the POM, which includes LegacySupport. Updated DefaultResources to inject and use LegacySupport for basedir resolution. Also updated the README with documentation for the new Resources API. See commit 495f4ad. |
|
are we ready to merge? |
|
I need to do final review and squash the commits, will try the next days, don't hesitate to ping me if I forget... |
Provide a new Resources API
This PR implements a new Resources API as requested in issue #76, following the same pattern as the Messages and Progress APIs.
Summary of Changes:
✅ New
org.codehaus.plexus.build.resourcespackage with:ResourcesInterface - Modern Path-based API with the following methods:hasDelta(Path file)- Check if file has changes (documented as "best effort" hint)refresh(Path file)- Mark file as modified during buildnewOutputStream(Path file)- Get output stream with change detection optimizationnewOutputStream(Path file, boolean derived)- Output stream with optional derived markerisUptodate(Path target, Path source)- Check if target is up-to-date with source (recommended over hasDelta for input/output scenarios)getPath(String relpath)- Convert relative path to Path (now uses Maven project basedir via LegacySupport)markDerived(Path file)- Mark file as generated/derived (IDE integration support)copy(Path source, Path target)- Convenience method to copy only when neededDefaultResourcesImplementation - Delegates to BuildContext for compatibility✅ Deprecated resource-related methods in BuildContext:
hasDelta(String),hasDelta(File),hasDelta(List<String>)refresh(File)newFileOutputStream(File)isUptodate(File, File)✅ Updated README with documentation for the new Resources API
✅ Key Design Decisions:
✅ Build Status: All builds passing with expected deprecation warnings
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.