[Git][java-team/plexus-build-api][upstream] 3 commits: New upstream version 1.0.0

Emmanuel Bourg (@ebourg) gitlab at salsa.debian.org
Fri Oct 30 09:33:40 GMT 2026



Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / plexus-build-api


Commits:
081e9711 by Emmanuel Bourg at 2026-10-30T09:51:59+01:00
New upstream version 1.0.0
- - - - -
ba0d0bb7 by Emmanuel Bourg at 2026-10-30T09:51:59+01:00
New upstream version 1.1.0
- - - - -
1812a581 by Emmanuel Bourg at 2026-10-30T09:52:00+01:00
New upstream version 1.2.0
- - - - -


17 changed files:

- + .github/dependabot.yml
- + .github/release-drafter.yml
- + .github/workflows/maven.yml
- + .github/workflows/release-drafter.yml
- + .gitignore
- + LICENSE
- + README.md
- pom.xml
- + src/main/java/org/codehaus/plexus/build/BuildContext.java
- + src/main/java/org/codehaus/plexus/build/DefaultBuildContext.java
- − src/main/java/org/sonatype/plexus/build/incremental/BuildContext.java
- − src/main/java/org/sonatype/plexus/build/incremental/DefaultBuildContext.java
- − src/main/java/org/sonatype/plexus/build/incremental/EmptyScanner.java
- − src/main/java/org/sonatype/plexus/build/incremental/ThreadBuildContext.java
- src/main/resources/org/sonatype/plexus/build/incremental/version.properties → src/main/resources/org/codehaus/plexus/build/version.properties
- − src/test/java/org/sonatype/plexus/build/incremental/test/TestFullBuildContext.java
- − src/test/java/org/sonatype/plexus/build/incremental/test/TestIncrementalBuildContext.java


Changes:

=====================================
.github/dependabot.yml
=====================================
@@ -0,0 +1,10 @@
+version: 2
+updates:
+  - package-ecosystem: "maven"
+    directory: "/"
+    schedule:
+      interval: "daily"
+  - package-ecosystem: "github-actions"
+    directory: "/"
+    schedule:
+      interval: "daily"


=====================================
.github/release-drafter.yml
=====================================
@@ -0,0 +1,2 @@
+_extends: .github
+tag-template: plexus-build-api-$NEXT_MINOR_VERSION


=====================================
.github/workflows/maven.yml
=====================================
@@ -0,0 +1,31 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: GitHub CI
+
+on: [push, pull_request]
+
+jobs:
+  build:
+    name: Build it
+    uses: codehaus-plexus/.github/.github/workflows/maven.yml at master
+
+  deploy:
+    name: Deploy
+    needs: build
+    uses: codehaus-plexus/.github/.github/workflows/maven-deploy.yml at master
+    secrets: inherit


=====================================
.github/workflows/release-drafter.yml
=====================================
@@ -0,0 +1,12 @@
+name: Release Drafter
+on:
+  push:
+    branches:
+      - master
+jobs:
+  update_release_draft:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: release-drafter/release-drafter at v5
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


=====================================
.gitignore
=====================================
@@ -0,0 +1,6 @@
+target/
+*.iml
+.idea/
+.classpath
+.project
+.settings/
\ No newline at end of file


=====================================
LICENSE
=====================================
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.


=====================================
README.md
=====================================
@@ -0,0 +1,32 @@
+Plexus Build API
+=======================
+
+[![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/codehaus-plexus/plexus-classworlds.svg?label=License)](http://www.apache.org/licenses/)
+[![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-build-api.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-build-api)
+![Build Status](https://github.com/codehaus-plexus/plexus-build-api/actions/workflows/maven.yml/badge.svg)
+
+This API allows IDEs to integrate with Maven deeper than it would be possible by just using regular Maven/Mojo API.
+
+It supports
+
+- incremental builds e.g. allows to query which files have been touched since last build
+- fine-grained error/info markers (referring to specific files in particular line numbers)
+- notifications about updated files
+
+
+Current Implementations
+-----
+
+### Default Implementation
+
+The default implementation shipping with this artifact is supposed to impose minimal overhead. It doesn't support incremental build and acts directly on the file system. Errors and warning are just logged through SLF4J.
+
+### M2Eclipse
+
+[M2Eclipse](https://www.eclipse.org/m2e/) is using this API for supporting both incremental builds and fully integrated error markers in Eclipse. They maintain information for Mojo developers at [Making Maven Plugins Compatible](https://www.eclipse.org/m2e/documentation/m2e-making-maven-plugins-compat.html).
+Currently only versions up to 0.0.7 (with old Maven coordinates `org.sonatype.plexus:plexus-build-api`) are supported, this limitation is tracked in [Issue 944](https://github.com/eclipse-m2e/m2e-core/issues/944).
+
+History
+-----
+
+The project was relocated from <https://github.com/sonatype/sisu-build-api>. Also its Maven coordinates changed from `org.sonatype.plexus:plexus-build-api` to `org.codehaus.plexus:plexus-build-api`, the API is still the same, though.


=====================================
pom.xml
=====================================
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <!-- 
 Copyright (c) 2008 Sonatype, Inc. All rights reserved.
 
@@ -10,48 +11,85 @@ software distributed under the Apache License Version 2.0 is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
 -->
-
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
+
   <parent>
-    <groupId>org.sonatype.spice</groupId>
-    <artifactId>spice-parent</artifactId>
-    <version>15</version>
+    <groupId>org.codehaus.plexus</groupId>
+    <artifactId>plexus</artifactId>
+    <version>13</version>
   </parent>
-  <groupId>org.sonatype.plexus</groupId>
+
   <artifactId>plexus-build-api</artifactId>
-  <version>0.0.7</version>
-  
+  <version>1.2.0</version>
+
+  <scm>
+    <connection>scm:git:https://github.com/codehaus-plexus/plexus-build-api.git</connection>
+    <developerConnection>${project.scm.connection}</developerConnection>
+    <tag>plexus-build-api-1.2.0</tag>
+    <url>https://github.com/codehaus-plexus/plexus-build-api/tree/master</url>
+  </scm>
+
   <dependencies>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
-      <version>1.5.8</version>
+      <version>4.0.0</version>
     </dependency>
     <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-container-default</artifactId>
-      <version>1.0-alpha-9</version>
-      <scope>provided</scope>
+      <groupId>javax.inject</groupId>
+      <artifactId>javax.inject</artifactId>
+      <version>1</version>
     </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.7.36</version>
+    </dependency>
+    <!-- The depednecies are only to support the legacy API therefore we exclude anything as we only need the API/classes -->
+    <dependency>
+      <groupId>org.sonatype.plexus</groupId>
+      <artifactId>plexus-build-api</artifactId>
+      <version>0.0.7</version>
+      <exclusions>
+        <exclusion>
+          <groupId>*</groupId>
+          <artifactId>*</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.sisu</groupId>
+      <artifactId>org.eclipse.sisu.plexus</artifactId>
+      <version>0.9.0.M2</version>
+      <exclusions>
+        <exclusion>
+          <groupId>*</groupId>
+          <artifactId>*</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+
   </dependencies>
 
   <build>
     <resources>
       <resource>
-        <directory>src/main/resources</directory>
         <filtering>true</filtering>
+        <directory>src/main/resources</directory>
       </resource>
     </resources>
     <plugins>
       <plugin>
-        <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-maven-plugin</artifactId>
-        <version>1.3.4</version>
+        <groupId>org.eclipse.sisu</groupId>
+        <artifactId>sisu-maven-plugin</artifactId>
+        <version>0.9.0.M2</version>
         <executions>
           <execution>
+            <id>index-project</id>
             <goals>
-              <goal>descriptor</goal>
+              <goal>main-index</goal>
+              <goal>test-index</goal>
             </goals>
           </execution>
         </executions>
@@ -60,14 +98,14 @@ See the Apache License Version 2.0 for the specific language governing permissio
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
+          <source>1.8</source>
+          <target>1.8</target>
         </configuration>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.4.2</version>
+        <version>3.1.0</version>
         <configuration>
           <skipTests>true</skipTests>
         </configuration>
@@ -83,12 +121,25 @@ See the Apache License Version 2.0 for the specific language governing permissio
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-scm-publish-plugin</artifactId>
+        <configuration>
+          <content>${project.reporting.outputDirectory}</content>
+          <!-- mono-module doesn't require site:stage -->
+        </configuration>
+        <executions>
+          <execution>
+            <id>scm-publish</id>
+            <!-- deploy site with maven-scm-publish-plugin -->
+            <goals>
+              <goal>publish-scm</goal>
+            </goals>
+            <phase>site-deploy</phase>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 
-  <scm>
-    <connection>scm:svn:http://svn.sonatype.org/spice/tags/plexus-build-api-0.0.7</connection>
-    <developerConnection>scm:svn:https://svn.sonatype.org/spice/tags/plexus-build-api-0.0.7</developerConnection>
-    <url>http://svn.sonatype.org/spice/tags/plexus-build-api-0.0.7</url>
-  </scm>
 </project>


=====================================
src/main/java/org/codehaus/plexus/build/BuildContext.java
=====================================
@@ -0,0 +1,240 @@
+/*
+Copyright (c) 2008 Sonatype, Inc. All rights reserved.
+
+This program is licensed to you under the Apache License Version 2.0,
+and you may not use this file except in compliance with the Apache License Version 2.0.
+You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the Apache License Version 2.0 is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
+*/
+package org.codehaus.plexus.build;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.List;
+
+import org.codehaus.plexus.util.Scanner;
+
+// TODO should it be BuildWorkspace or something like that?
+/**
+ * <p>BuildContext interface.</p>
+ */
+public interface BuildContext {
+    /** Constant <code>SEVERITY_WARNING=1</code> */
+    int SEVERITY_WARNING = 1;
+
+    /** Constant <code>SEVERITY_ERROR=2</code> */
+    int SEVERITY_ERROR = 2;
+
+    // TODO should we add File getBasedir()?
+
+    /**
+     * Returns <code>true</code> if file or folder identified by <code>relpath</code> has
+     * changed since last build.
+     *
+     * @param relpath is path relative to build context basedir
+     * @return a boolean.
+     */
+    boolean hasDelta(String relpath);
+
+    /**
+     * Returns <code>true</code> if the file has changed since last build or is not
+     * under basedir.
+     *
+     * @since 0.0.5
+     * @param file a {@link java.io.File} object.
+     * @return a boolean.
+     */
+    boolean hasDelta(File file);
+
+    /**
+     * Returns <code>true</code> if any file or folder identified by <code>relpaths</code> has
+     * changed since last build.
+     *
+     * @param relpaths paths relative to build context basedir
+     * @return a boolean.
+     */
+    boolean hasDelta(List<String> relpaths);
+
+    /**
+     * Indicates that the file or folder content has been modified during the build.
+     *
+     * @see #newFileOutputStream(File)
+     * @param file a {@link java.io.File} object.
+     */
+    void refresh(File file);
+
+    /**
+     * Returns new OutputStream that writes to the <code>file</code>.
+     *
+     * Files changed using OutputStream returned by this method do not need to be
+     * explicitly refreshed using {@link #refresh(File)}.
+     *
+     * As an optional optimisation, OutputStreams created by incremental build
+     * context will attempt to avoid writing to the file if file content
+     * has not changed.
+     *
+     * @param file a {@link java.io.File} object.
+     * @return a {@link java.io.OutputStream} object.
+     * @throws java.io.IOException if any.
+     */
+    OutputStream newFileOutputStream(File file) throws IOException;
+
+    /**
+     * Convenience method, fully equal to newScanner(basedir, false)
+     *
+     * @param basedir a {@link java.io.File} object.
+     * @return a {@link org.codehaus.plexus.util.Scanner} object.
+     */
+    Scanner newScanner(File basedir);
+
+    /**
+     * Returned Scanner scans <code>basedir</code> for files and directories
+     * deleted since last build. Returns empty Scanner if <code>basedir</code>
+     * is not under this build context basedir.
+     *
+     * @param basedir a {@link java.io.File} object.
+     * @return a {@link org.codehaus.plexus.util.Scanner} object.
+     */
+    Scanner newDeleteScanner(File basedir);
+
+    /**
+     * Returned Scanner scans files and folders under <code>basedir</code>.
+     *
+     * If this is an incremental build context and  <code>ignoreDelta</code>
+     * is <code>false</code>, the scanner will only "see" files and folders with
+     * content changes since last build.
+     *
+     * If <code>ignoreDelta</code> is <code>true</code>, the scanner will "see" all
+     * files and folders.
+     *
+     * Please beware that ignoreDelta=false does NOT work reliably for operations
+     * that copy resources from source to target locations. Returned Scanner
+     * only scans changed source resources and it does not consider changed or deleted
+     * target resources. This results in missing or stale target resources.
+     * Starting with 0.5.0, recommended way to process resources is to use
+     * #newScanner(basedir,true) to locate all source resources and {@link #isUptodate(File, File)}
+     * to optimized processing of uptodate target resources.
+     *
+     * Returns empty Scanner if <code>basedir</code> is not under this build context basedir.
+     *
+     * https://issues.apache.org/jira/browse/MSHARED-125
+     *
+     * @param basedir a {@link java.io.File} object.
+     * @param ignoreDelta a boolean.
+     * @return a {@link org.codehaus.plexus.util.Scanner} object.
+     */
+    Scanner newScanner(File basedir, boolean ignoreDelta);
+
+    /**
+     * Returns <code>true</code> if this build context is incremental.
+     *
+     * Scanners created by {@link #newScanner(File)} of an incremental build context
+     * will ignore files and folders that were not changed since last build.
+     * Additionally, {@link #newDeleteScanner(File)} will scan files and directories
+     * deleted since last build.
+     *
+     * @return a boolean.
+     */
+    boolean isIncremental();
+
+    /**
+     * Associate specified <code>key</code> with specified <code>value</code>
+     * in the build context.
+     *
+     * Primary (and the only) purpose of this method is to allow preservation of
+     * state needed for proper incremental behaviour between consecutive executions
+     * of the same mojo needed to.
+     *
+     * For example, maven-plugin-plugin:descriptor mojo
+     * can store collection of extracted MojoDescritpor during first invocation. Then
+     * on each consecutive execution maven-plugin-plugin:descriptor will only need
+     * to extract MojoDescriptors for changed files.
+     *
+     * @see #getValue(String)
+     * @param key a {@link java.lang.String} object.
+     * @param value a {@link java.lang.Object} object.
+     */
+    void setValue(String key, Object value);
+
+    /**
+     * Returns value associated with <code>key</code> during previous mojo execution.
+     *
+     * This method always returns <code>null</code> for non-incremental builds
+     * (i.e., {@link #isIncremental()} returns <code>false</code>) and mojos are
+     * expected to fall back to full, non-incremental behaviour.
+     *
+     * @see #setValue(String, Object)
+     * @see #isIncremental()
+     * @param key a {@link java.lang.String} object.
+     * @return a {@link java.lang.Object} object.
+     */
+    Object getValue(String key);
+
+    /**
+     * <p>addWarning.</p>
+     *
+     * @deprecated Use addMessage with severity=SEVERITY_ERROR instead
+     * @since 0.0.5
+     * @param file a {@link java.io.File} object.
+     * @param line a int.
+     * @param column a int.
+     * @param message a {@link java.lang.String} object.
+     * @param cause a {@link java.lang.Throwable} object.
+     */
+    void addWarning(File file, int line, int column, String message, Throwable cause);
+
+    /**
+     * <p>addError.</p>
+     *
+     * @deprecated Use addMessage with severity=SEVERITY_WARNING instead
+     * @since 0.0.5
+     * @param file a {@link java.io.File} object.
+     * @param line a int.
+     * @param column a int.
+     * @param message a {@link java.lang.String} object.
+     * @param cause a {@link java.lang.Throwable} object.
+     */
+    void addError(File file, int line, int column, String message, Throwable cause);
+
+    /**
+     * Adds a message to the build context. The message is associated with a file and a location inside that file.
+     *
+     * @param file The file or folder with which the message is associated. Should not be null and it is recommended to be
+     *          an absolute path.
+     * @param line The line number inside the file. Use 1 (not 0) for the first line. Use 0 for unknown/unspecified.
+     * @param column The column number inside the file. Use 1 (not 0) for the first column. Use 0 for unknown/unspecified.
+     * @param severity The severity of the message: SEVERITY_WARNING or SEVERITY_ERROR.
+     * @param cause A Throwable object associated with the message. Can be null.
+     * @since 0.0.7
+     * @param message a {@link java.lang.String} object.
+     */
+    void addMessage(File file, int line, int column, String message, int severity, Throwable cause);
+
+    /**
+     * Removes all messages associated with a file or folder during a previous build. It does not affect the messages
+     * added during the current build.
+     *
+     * @since 0.0.7
+     * @param file a {@link java.io.File} object.
+     */
+    void removeMessages(File file);
+
+    /**
+     * Returns true, if the target file exists and is uptodate compared to the source file.
+     *
+     * More specifically, this method returns true when both target and source files exist,
+     * do not have changes since last incremental build and the target file was last modified
+     * later than the source file. Returns false in all other cases.
+     *
+     * @since 0.0.5
+     * @param target a {@link java.io.File} object.
+     * @param source a {@link java.io.File} object.
+     * @return a boolean.
+     */
+    boolean isUptodate(File target, File source);
+}


=====================================
src/main/java/org/codehaus/plexus/build/DefaultBuildContext.java
=====================================
@@ -0,0 +1,195 @@
+/*
+Copyright (c) 2008 Sonatype, Inc. All rights reserved.
+
+This program is licensed to you under the Apache License Version 2.0,
+and you may not use this file except in compliance with the Apache License Version 2.0.
+You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the Apache License Version 2.0 is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
+*/
+
+package org.codehaus.plexus.build;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.Scanner;
+import org.codehaus.plexus.util.io.CachingOutputStream;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Filesystem based non-incremental build context implementation which behaves
+ * as if all files were just created. More specifically,
+ *
+ * <ol>
+ * <li>hasDelta returns <code>true</code> for all paths</li>
+ * <li>newScanner returns Scanner that scans all files under provided
+ * basedir</li>
+ * <li>newDeletedScanner always returns empty scanner</li>
+ * <li>isIncremental returns <code>false</code></li>
+ * <li>getValue always returns the last set value in this session and only
+ * stores to memory</li>
+ * </ol>
+ */
+ at Named("default")
+ at Singleton
+public class DefaultBuildContext implements BuildContext {
+
+    private final Logger logger = LoggerFactory.getLogger(DefaultBuildContext.class);
+    // the legacy API requires the AbstractLogEnabled we just have it here to get
+    // compile errors in case it is missing from the classpath!
+    @SuppressWarnings("unused")
+    private static final AbstractLogEnabled DUMMY = null;
+
+    private final Map<String, Object> contextMap = new ConcurrentHashMap<>();
+    private org.sonatype.plexus.build.incremental.BuildContext legacy;
+
+    /**
+     * @param legacy the legacy API we delegate to by default, this allow us to
+     *               support "older" plugins and implementors of the API while still
+     *               having a way to move forward!
+     */
+    @Inject
+    public DefaultBuildContext(org.sonatype.plexus.build.incremental.BuildContext legacy) {
+        this.legacy = legacy;
+    }
+
+    /** {@inheritDoc} */
+    public boolean hasDelta(String relpath) {
+        return legacy.hasDelta(relpath);
+    }
+
+    /**
+     * <p>hasDelta.</p>
+     *
+     * @param file a {@link java.io.File} object.
+     * @return a boolean.
+     */
+    public boolean hasDelta(File file) {
+        return legacy.hasDelta(file);
+    }
+
+    /**
+     * <p>hasDelta.</p>
+     *
+     * @param relpaths a {@link java.util.List} object.
+     * @return a boolean.
+     */
+    public boolean hasDelta(List<String> relpaths) {
+        return legacy.hasDelta(relpaths);
+    }
+
+    /** {@inheritDoc} */
+    public OutputStream newFileOutputStream(File file) throws IOException {
+        if (isDefaultImplementation()) {
+            return new CachingOutputStream(file.toPath());
+        }
+        return legacy.newFileOutputStream(file);
+    }
+
+    /**
+     * @return <code>true</code> if the legacy is the default implementation and we
+     *         can safely override/change behavior here, or <code>false</code> if a
+     *         custom implementation is used and full delegation is required.
+     */
+    private boolean isDefaultImplementation() {
+        return legacy.getClass().equals(org.sonatype.plexus.build.incremental.DefaultBuildContext.class);
+    }
+
+    /** {@inheritDoc} */
+    public Scanner newScanner(File basedir) {
+        return legacy.newScanner(basedir);
+    }
+
+    /** {@inheritDoc} */
+    public void refresh(File file) {
+        legacy.refresh(file);
+    }
+
+    /** {@inheritDoc} */
+    public Scanner newDeleteScanner(File basedir) {
+        return legacy.newDeleteScanner(basedir);
+    }
+
+    /** {@inheritDoc} */
+    public Scanner newScanner(File basedir, boolean ignoreDelta) {
+        return legacy.newScanner(basedir, ignoreDelta);
+    }
+
+    /**
+     * <p>isIncremental.</p>
+     *
+     * @return a boolean.
+     */
+    public boolean isIncremental() {
+        return legacy.isIncremental();
+    }
+
+    /** {@inheritDoc} */
+    public Object getValue(String key) {
+        return contextMap.get(key);
+    }
+
+    /** {@inheritDoc} */
+    public void setValue(String key, Object value) {
+        contextMap.put(key, value);
+    }
+
+    /** {@inheritDoc} */
+    public void addError(File file, int line, int column, String message, Throwable cause) {
+        addMessage(file, line, column, message, SEVERITY_ERROR, cause);
+    }
+
+    /** {@inheritDoc} */
+    public void addWarning(File file, int line, int column, String message, Throwable cause) {
+        addMessage(file, line, column, message, SEVERITY_WARNING, cause);
+    }
+
+    private String getMessage(File file, int line, int column, String message) {
+        return file.getAbsolutePath() + " [" + line + ':' + column + "]: " + message;
+    }
+
+    /** {@inheritDoc} */
+    public void addMessage(File file, int line, int column, String message, int severity, Throwable cause) {
+        if (isDefaultImplementation()) {
+            switch (severity) {
+                case BuildContext.SEVERITY_ERROR:
+                    logger.error(getMessage(file, line, column, message), cause);
+                    return;
+                case BuildContext.SEVERITY_WARNING:
+                    logger.warn(getMessage(file, line, column, message), cause);
+                    return;
+                default:
+                    logger.debug(getMessage(file, line, column, message), cause);
+                    return;
+            }
+        }
+        legacy.addMessage(file, line, column, message, severity, cause);
+    }
+
+    /** {@inheritDoc} */
+    public void removeMessages(File file) {
+        if (isDefaultImplementation()) {
+            return;
+        }
+        legacy.removeMessages(file);
+    }
+
+    /** {@inheritDoc} */
+    public boolean isUptodate(File target, File source) {
+        return legacy.isUptodate(target, source);
+    }
+}


=====================================
src/main/java/org/sonatype/plexus/build/incremental/BuildContext.java deleted
=====================================
@@ -1,192 +0,0 @@
-/*
-Copyright (c) 2008 Sonatype, Inc. All rights reserved.
-
-This program is licensed to you under the Apache License Version 2.0, 
-and you may not use this file except in compliance with the Apache License Version 2.0. 
-You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
-
-Unless required by applicable law or agreed to in writing, 
-software distributed under the Apache License Version 2.0 is distributed on an 
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
-*/
-package org.sonatype.plexus.build.incremental;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.List;
-
-import org.codehaus.plexus.util.Scanner;
-
-
-// TODO should it be BuildWorkspace or something like that?
-public interface BuildContext {
-  public static final int SEVERITY_WARNING = 1;
-
-  public static final int SEVERITY_ERROR = 2;
-
-  // TODO should we add File getBasedir()?
-  
-  /**
-   * Returns <code>true</code> if file or folder identified by <code>relpath</code> has 
-   * changed since last build. 
-   * 
-   * @param relpath is path relative to build context basedir
-   */
-  boolean hasDelta(String relpath);
-
-  /**
-   * Returns <code>true</code> if the file has changed since last build or is not
-   * under basedir.
-   * 
-   * @since 0.0.5
-   */
-  boolean hasDelta(File file);
-
-  /**
-   * Returns <code>true</code> if any file or folder identified by <code>relpaths</code> has 
-   * changed since last build.
-   *  
-   * @param relpaths List<String> are paths relative to build context basedir
-   */
-  boolean hasDelta(List relpaths);
-
-  /**
-   * Indicates that the file or folder content has been modified during the build.
-   * 
-   * @see #newFileOutputStream(File)
-   */
-  void refresh(File file);
-
-  /**
-   * Returns new OutputStream that writes to the <code>file</code>.
-   *  
-   * Files changed using OutputStream returned by this method do not need to be
-   * explicitly refreshed using {@link #refresh(File)}.
-   *
-   * As an optional optimisation, OutputStreams created by incremental build 
-   * context will attempt to avoid writing to the file if file content 
-   * has not changed.
-   */
-  OutputStream newFileOutputStream(File file) throws IOException;
-
-  /**
-   * Convenience method, fully equal to newScanner(basedir, false)
-   */
-  Scanner newScanner(File basedir);
-
-  /**
-   * Returned Scanner scans <code>basedir</code> for files and directories 
-   * deleted since last build. Returns empty Scanner if <code>basedir</code>
-   * is not under this build context basedir.
-   */
-  Scanner newDeleteScanner(File basedir);
-
-  /**
-   * Returned Scanner scans files and folders under <code>basedir</code>.
-   * 
-   * If this is an incremental build context and  <code>ignoreDelta</code> 
-   * is <code>false</code>, the scanner will only "see" files and folders with 
-   * content changes since last build. 
-   * 
-   * If <code>ignoreDelta</code> is <code>true</code>, the scanner will "see" all
-   * files and folders. 
-   * 
-   * Please beware that ignoreDelta=false does NOT work reliably for operations
-   * that copy resources from source to target locations. Returned Scanner
-   * only scans changed source resources and it does not consider changed or deleted
-   * target resources. This results in missing or stale target resources.
-   * Starting with 0.5.0, recommended way to process resources is to use
-   * #newScanner(basedir,true) to locate all source resources and {@link #isUptodate(File, File)}
-   * to optimized processing of uptodate target resources. 
-   * 
-   * Returns empty Scanner if <code>basedir</code> is not under this build context basedir.
-   * 
-   * @see http://jira.codehaus.org/browse/MSHARED-125
-   */
-  Scanner newScanner(File basedir, boolean ignoreDelta);
-
-  /**
-   * Returns <code>true</code> if this build context is incremental. 
-   * 
-   * Scanners created by {@link #newScanner(File)} of an incremental build context
-   * will ignore files and folders that were not changed since last build. 
-   * Additionally, {@link #newDeleteScanner(File)} will scan files and directories
-   * deleted since last build.
-   */
-  boolean isIncremental();
-
-  /**
-   * Associate specified <code>key</code> with specified <code>value</code>
-   * in the build context.
-   * 
-   * Primary (and the only) purpose of this method is to allow preservation of 
-   * state needed for proper incremental behaviour between consecutive executions 
-   * of the same mojo needed to. 
-   * 
-   * For example, maven-plugin-plugin:descriptor mojo
-   * can store collection of extracted MojoDescritpor during first invocation. Then
-   * on each consecutive execution maven-plugin-plugin:descriptor will only need
-   * to extract MojoDescriptors for changed files.
-   *
-   * @see #getValue(String)
-   */
-  void setValue(String key, Object value);
-
-  /**
-   * Returns value associated with <code>key</code> during previous mojo execution.
-   * 
-   * This method always returns <code>null</code> for non-incremental builds
-   * (i.e., {@link #isIncremental()} returns <code>false</code>) and mojos are 
-   * expected to fall back to full, non-incremental behaviour.
-   * 
-   * @see #setValue(String, Object)
-   * @see #isIncremental()
-   */
-  Object getValue(String key);
-
-  /**
-   * @deprecated Use addMessage with severity=SEVERITY_ERROR instead
-   * @since 0.0.5
-   */
-  void addWarning(File file, int line, int column, String message, Throwable cause);
-
-  /**
-   * @deprecated Use addMessage with severity=SEVERITY_WARNING instead
-   * @since 0.0.5
-   */
-  void addError(File file, int line, int column, String message, Throwable cause);
-
-  /**
-   * Adds a message to the build context. The message is associated with a file and a location inside that file.
-   * 
-   * @param file The file or folder with which the message is associated. Should not be null and it is recommended to be
-   *          an absolute path.
-   * @param line The line number inside the file. Use 1 (not 0) for the first line. Use 0 for unknown/unspecified.
-   * @param column The column number inside the file. Use 1 (not 0) for the first column. Use 0 for unknown/unspecified.
-   * @param severity The severity of the message: SEVERITY_WARNING or SEVERITY_ERROR.
-   * @param cause A Throwable object associated with the message. Can be null.
-   * @since 0.0.7
-   */
-  void addMessage(File file, int line, int column, String message, int severity, Throwable cause);
-
-  /**
-   * Removes all messages associated with a file or folder during a previous build. It does not affect the messages
-   * added during the current build.
-   * 
-   * @since 0.0.7
-   */
-  void removeMessages(File file);
-
-  /**
-   * Returns true, if the target file exists and is uptodate compared to the source file.
-   * 
-   * More specifically, this method returns true when both target and source files exist,
-   * do not have changes since last incremental build and the target file was last modified
-   * later than the source file. Returns false in all other cases.
-   * 
-   * @since 0.0.5
-   */
-  boolean isUptodate(File target, File source);
-}


=====================================
src/main/java/org/sonatype/plexus/build/incremental/DefaultBuildContext.java deleted
=====================================
@@ -1,126 +0,0 @@
-/*
-Copyright (c) 2008 Sonatype, Inc. All rights reserved.
-
-This program is licensed to you under the Apache License Version 2.0, 
-and you may not use this file except in compliance with the Apache License Version 2.0. 
-You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
-
-Unless required by applicable law or agreed to in writing, 
-software distributed under the Apache License Version 2.0 is distributed on an 
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
-*/
-
-package org.sonatype.plexus.build.incremental;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.List;
-
-import org.codehaus.plexus.logging.AbstractLogEnabled;
-import org.codehaus.plexus.util.DirectoryScanner;
-import org.codehaus.plexus.util.Scanner;
-
-/**
- * Filesystem based non-incremental build context implementation which behaves as if all files
- * were just created. More specifically, 
- * 
- * hasDelta returns <code>true</code> for all paths
- * newScanner returns Scanner that scans all files under provided basedir
- * newDeletedScanner always returns empty scanner.
- * isIncremental returns <code>false</code<
- * getValue always returns <code>null</code>
- * 
- * @plexus.component role="org.sonatype.plexus.build.incremental.BuildContext"
- *                   role-hint="default"
- */
-public class DefaultBuildContext extends AbstractLogEnabled implements BuildContext {
-
-  public boolean hasDelta(String relpath) {
-    return true;
-  }
-
-  public boolean hasDelta(File file) {
-    return true;
-  }
-
-  public boolean hasDelta(List relpaths) {
-    return true;
-  }
-
-  public OutputStream newFileOutputStream(File file) throws IOException {
-    return new FileOutputStream(file);
-  }
-
-  public Scanner newScanner(File basedir) {
-    DirectoryScanner ds = new DirectoryScanner();
-    ds.setBasedir(basedir);
-    return ds;
-  }
-
-  public void refresh(File file) {
-    // do nothing
-  }
-
-  public Scanner newDeleteScanner(File basedir) {
-    return new EmptyScanner(basedir);
-  }
-
-  public Scanner newScanner(File basedir, boolean ignoreDelta) {
-    return newScanner(basedir);
-  }
-
-  public boolean isIncremental() {
-    return false;
-  }
-
-  public Object getValue(String key) {
-    return null;
-  }
-
-  public void setValue(String key, Object value) {
-  }
-
-  private String getMessage(File file, int line, int column, String message) {
-    StringBuffer sb = new StringBuffer();
-    sb.append(file.getAbsolutePath()).append(" [").append(line).append(':').append(column).append("]: ");
-    sb.append(message);
-    return sb.toString();
-  }
-
-  /**
-   * @deprecated Use addMessage with severity=SEVERITY_ERROR instead
-   */
-  public void addError(File file, int line, int column, String message, Throwable cause) {
-    addMessage(file, line, column, message, SEVERITY_ERROR, cause);
-  }
-
-  /**
-   * @deprecated Use addMessage with severity=SEVERITY_WARNING instead
-   */
-  public void addWarning(File file, int line, int column, String message, Throwable cause) {
-    addMessage(file, line, column, message, SEVERITY_WARNING, cause);
-  }
-
-  public void addMessage(File file, int line, int column, String message, int severity, Throwable cause) {
-    switch(severity) {
-      case BuildContext.SEVERITY_ERROR:
-        getLogger().error(getMessage(file, line, column, message), cause);
-        return;
-      case BuildContext.SEVERITY_WARNING:
-        getLogger().warn(getMessage(file, line, column, message), cause);
-        return;
-    }
-    throw new IllegalArgumentException("severity=" + severity);
-  }
-
-  public void removeMessages(File file) {
-  }
-
-  public boolean isUptodate(File target, File source) {
-    return target != null && target.exists() && source != null && source.exists()
-        && target.lastModified() > source.lastModified();
-  }
-}


=====================================
src/main/java/org/sonatype/plexus/build/incremental/EmptyScanner.java deleted
=====================================
@@ -1,57 +0,0 @@
-/*
-Copyright (c) 2008 Sonatype, Inc. All rights reserved.
-
-This program is licensed to you under the Apache License Version 2.0, 
-and you may not use this file except in compliance with the Apache License Version 2.0. 
-You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
-
-Unless required by applicable law or agreed to in writing, 
-software distributed under the Apache License Version 2.0 is distributed on an 
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
-*/
-
-package org.sonatype.plexus.build.incremental;
-
-import java.io.File;
-
-import org.codehaus.plexus.util.Scanner;
-
-/**
- * Scanner implementation never finds any files/directories.
- */
-public class EmptyScanner implements Scanner {
-  
-  private static final String[] EMPTY_STRING_ARRAY = new String[0];
-  
-  private final File basedir;
-  
-  public EmptyScanner(File basedir) {
-    this.basedir = basedir;
-  }
-
-  public void addDefaultExcludes() {
-  }
-
-  public String[] getIncludedDirectories() {
-    return EMPTY_STRING_ARRAY;
-  }
-
-  public String[] getIncludedFiles() {
-    return EMPTY_STRING_ARRAY;
-  }
-
-  public void scan() {
-  }
-
-  public void setExcludes(String[] excludes) {
-  }
-
-  public void setIncludes(String[] includes) {
-  }
-
-  public File getBasedir() {
-    return basedir;
-  }
-
-}


=====================================
src/main/java/org/sonatype/plexus/build/incremental/ThreadBuildContext.java deleted
=====================================
@@ -1,119 +0,0 @@
-/*
-Copyright (c) 2008 Sonatype, Inc. All rights reserved.
-
-This program is licensed to you under the Apache License Version 2.0, 
-and you may not use this file except in compliance with the Apache License Version 2.0. 
-You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
-
-Unless required by applicable law or agreed to in writing, 
-software distributed under the Apache License Version 2.0 is distributed on an 
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
-*/
-
-package org.sonatype.plexus.build.incremental;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.List;
-
-import org.codehaus.plexus.util.Scanner;
-
-/**
- * BuildContext implementation that delegates actual work to thread-local
- * build context set using {@link #setThreadBuildContext(BuildContext)}.
- * {@link DefaultBuildContext} is used if no thread local build context was set.
- * 
- * Note that plexus component metadata is not generated for this implementation.
- * Apparently, older version of plexus used by maven-filtering and likely
- * other projects, does not honour "default" role-hint.
- */
-public class ThreadBuildContext implements BuildContext {
-
-  private static final ThreadLocal threadContext = new ThreadLocal();
-
-  private static final DefaultBuildContext defaultContext = new DefaultBuildContext();
-
-  public static BuildContext getContext() {
-    BuildContext context = (BuildContext) threadContext.get();
-    if(context == null) {
-      context = defaultContext;
-    }
-    return context;
-  }
-
-  public static void setThreadBuildContext(BuildContext context) {
-    threadContext.set(context);
-  }
-
-  public boolean hasDelta(String relPath) {
-    return getContext().hasDelta(relPath);
-  }
-
-  public boolean hasDelta(File file) {
-    return getContext().hasDelta(file);
-  }
-
-  public boolean hasDelta(List relPaths) {
-    return getContext().hasDelta(relPaths);
-  }
-
-  public Scanner newDeleteScanner(File basedir) {
-    return getContext().newDeleteScanner(basedir);
-  }
-
-  public OutputStream newFileOutputStream(File file) throws IOException {
-    return getContext().newFileOutputStream(file);
-  }
-
-  public Scanner newScanner(File basedir) {
-    return getContext().newScanner(basedir);
-  }
-
-  public Scanner newScanner(File basedir, boolean ignoreDelta) {
-    return getContext().newScanner(basedir, ignoreDelta);
-  }
-
-  public void refresh(File file) {
-    getContext().refresh(file);
-  }
-
-  public Object getValue(String key) {
-    return getContext().getValue(key);
-  }
-
-  public boolean isIncremental() {
-    return getContext().isIncremental();
-  }
-
-  public void setValue(String key, Object value) {
-    getContext().setValue(key, value);
-  }
-
-  public void addMessage(File file, int line, int column, String message, int severity, Throwable cause) {
-    getContext().addMessage(file, line, column, message, severity, cause);
-  }
-
-  public void removeMessages(File file) {
-    getContext().removeMessages(file);
-  }
-
-  /**
-   * @deprecated Use addMessage with severity=SEVERITY_WARNING instead
-   */
-  public void addWarning(File file, int line, int column, String message, Throwable cause) {
-    addMessage(file, line, column, message, BuildContext.SEVERITY_WARNING, cause);
-  }
-
-  /**
-   * @deprecated Use addMessage with severity=SEVERITY_ERROR instead
-   */
-  public void addError(File file, int line, int column, String message, Throwable cause) {
-    addMessage(file, line, column, message, BuildContext.SEVERITY_ERROR, cause);
-  }
-
-  public boolean isUptodate(File target, File source) {
-    return getContext().isUptodate(target, source);
-  }
-}


=====================================
src/main/resources/org/sonatype/plexus/build/incremental/version.properties → src/main/resources/org/codehaus/plexus/build/version.properties
=====================================


=====================================
src/test/java/org/sonatype/plexus/build/incremental/test/TestFullBuildContext.java deleted
=====================================
@@ -1,33 +0,0 @@
-/*
-Copyright (c) 2008 Sonatype, Inc. All rights reserved.
-
-This program is licensed to you under the Apache License Version 2.0, 
-and you may not use this file except in compliance with the Apache License Version 2.0. 
-You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
-
-Unless required by applicable law or agreed to in writing, 
-software distributed under the Apache License Version 2.0 is distributed on an 
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
-*/
-
-package org.sonatype.plexus.build.incremental.test;
-
-import java.util.Map;
-
-import org.sonatype.plexus.build.incremental.DefaultBuildContext;
-
-
-public class TestFullBuildContext extends DefaultBuildContext {
-
-  private final Map context;
-
-  public TestFullBuildContext(Map context) {
-    this.context = context;
-  }
-
-  public void setValue(String key, Object value) {
-    context.put(key, value);
-  }
-
-}


=====================================
src/test/java/org/sonatype/plexus/build/incremental/test/TestIncrementalBuildContext.java deleted
=====================================
@@ -1,198 +0,0 @@
-/*
-Copyright (c) 2008 Sonatype, Inc. All rights reserved.
-
-This program is licensed to you under the Apache License Version 2.0, 
-and you may not use this file except in compliance with the Apache License Version 2.0. 
-You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
-
-Unless required by applicable law or agreed to in writing, 
-software distributed under the Apache License Version 2.0 is distributed on an 
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
-*/
-
-package org.sonatype.plexus.build.incremental.test;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.codehaus.plexus.util.DirectoryScanner;
-import org.codehaus.plexus.util.Scanner;
-import org.sonatype.plexus.build.incremental.BuildContext;
-
-public class TestIncrementalBuildContext implements BuildContext {
-
-  private final File basedir;
-
-  private final HashSet refresh = new HashSet();
-
-  private static final class TestScanner implements Scanner {
-    private final File basedir;
-    private final Set files;
-
-    private TestScanner(File basedir, Set files) {
-      this.basedir = basedir;
-      this.files = files;
-    }
-
-    public void addDefaultExcludes() {
-    }
-
-    public String[] getIncludedDirectories() {
-      return new String[0];
-    }
-
-    public String[] getIncludedFiles() {
-      return (String[]) files.toArray(new String[files.size()]);
-    }
-
-    public void scan() {
-    }
-
-    public void setExcludes(String[] excludes) {
-    }
-
-    public void setIncludes(String[] includes) {
-    }
-
-    public File getBasedir() {
-      return basedir;
-    }
-  }
-
-  private final Set changedFiles;
-
-  private final Set deletedFiles;
-
-  private final Map context;
-
-  private final List warnings;
-  
-  private final List errors;
-
-  public TestIncrementalBuildContext(File basedir, Set changedFiles, Map context) {
-    this(basedir, changedFiles, new HashSet(), context);
-  }
-
-  public TestIncrementalBuildContext(File basedir, Set changedFiles, Set deletedFiles, Map context) {
-    this(basedir, changedFiles, new HashSet(), context, new ArrayList(), new ArrayList());
-  }
-
-  public TestIncrementalBuildContext(File basedir, Set changedFiles, Set deletedFiles, Map context, List warnings, List errors) {
-    this.basedir = basedir;
-    this.changedFiles = changedFiles;
-    this.deletedFiles = deletedFiles;
-    this.context = context;
-    this.warnings = warnings;
-    this.errors = errors;
-  }
-
-  public boolean hasDelta(String relpath) {
-    String basepath = basedir.getAbsolutePath();
-
-    if (relpath.startsWith(basepath)) {
-      relpath = relpath.substring(basepath.length() + 1);
-    }
-
-    return changedFiles.contains(relpath) || deletedFiles.contains(relpath);
-  }
-
-  public boolean hasDelta(List relpaths) {
-    for(Iterator i = relpaths.iterator(); i.hasNext();) {
-      String relpath = (String) i.next();
-      if(hasDelta(relpath)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  public boolean hasDelta(File file) {
-    String relpath = getRelpath(file);
-	return relpath == null || hasDelta(relpath);
-  }
-
-  private String getRelpath(File file) {
-    try {
-      String path = file.getCanonicalPath();
-      String basepath = basedir.getCanonicalPath();
-      if (path.startsWith(basepath) && !path.equals(basepath)) {
-        return path.substring(basepath.length());
-      } else {
-        return null;
-      }
-    } catch (IOException e) {
-      // this is a test implementation, we can be little loose here
-      throw new IllegalArgumentException(e);
-    }
-  }
-
-public boolean isIncremental() {
-    return true;
-  }
-
-  public Scanner newDeleteScanner(File basedir) {
-    return new TestScanner(basedir, deletedFiles);
-  }
-
-  public OutputStream newFileOutputStream(File file) throws IOException {
-    refresh(file);
-    return new FileOutputStream(file);
-  }
-
-  public Scanner newScanner(final File basedir) {
-    return new TestScanner(basedir, changedFiles);
-  }
-
-  public Scanner newScanner(File basedir, boolean ignoreDelta) {
-    if(ignoreDelta) {
-      DirectoryScanner directoryScanner = new DirectoryScanner();
-      directoryScanner.setBasedir(basedir);
-      return directoryScanner;
-    }
-
-    return newScanner(basedir);
-  }
-
-  public void refresh(File file) {
-    refresh.add(file.getAbsoluteFile());
-  }
-
-  public Object getValue(String key) {
-    return context.get(key);
-  }
-
-  public void setValue(String key, Object value) {
-    context.put(key, value);
-  }
-
-  public Set getRefreshFiles() {
-    return refresh;
-  }
-
-  public void addError(File file, int line, int column, String message, Throwable cause) {
-  }
-
-  public void addWarning(File file, int line, int column, String message, Throwable cause) {
-  }
-
-  public void addMessage(File file, int line, int column, String message, int severity, Throwable cause) {
-  }
-
-  public void removeMessages(File file) {
-  }
-
-  public boolean isUptodate(File target, File source) {
-    return target != null && target.exists() && !hasDelta(target)
-        && source != null && source.exists() && !hasDelta(source)
-        && target.lastModified() > source.lastModified();
-  }
-}



View it on GitLab: https://salsa.debian.org/java-team/plexus-build-api/-/compare/bb2df1f16fd8e7f83ba520da5a9439086c5340b5...1812a5810c8b2cff155baa19de837bf57260f8b5

-- 
View it on GitLab: https://salsa.debian.org/java-team/plexus-build-api/-/compare/bb2df1f16fd8e7f83ba520da5a9439086c5340b5...1812a5810c8b2cff155baa19de837bf57260f8b5
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20261030/5cd0cc5a/attachment.htm>


More information about the pkg-java-commits mailing list