diff --git a/src/main/java/org/codehaus/plexus/build/DefaultBuildContext.java b/src/main/java/org/codehaus/plexus/build/DefaultBuildContext.java index 049ae0e..f83c6ba 100644 --- a/src/main/java/org/codehaus/plexus/build/DefaultBuildContext.java +++ b/src/main/java/org/codehaus/plexus/build/DefaultBuildContext.java @@ -21,6 +21,8 @@ import java.io.OutputStream; import java.nio.file.Files; import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.codehaus.plexus.util.DirectoryScanner; import org.codehaus.plexus.util.Scanner; @@ -28,19 +30,24 @@ import org.slf4j.LoggerFactory; /** - * Filesystem based non-incremental build context implementation which behaves as if all files - * were just created. More specifically, + * Filesystem based non-incremental build context implementation which behaves + * as if all files were just created. More specifically, * - * hasDelta returns true for all paths - * newScanner returns Scanner that scans all files under provided basedir - * newDeletedScanner always returns empty scanner. - * isIncremental returns false - * getValue always returns null + *
    + *
  1. hasDelta returns true for all paths
  2. + *
  3. newScanner returns Scanner that scans all files under provided + * basedir
  4. + *
  5. newDeletedScanner always returns empty scanner
  6. + *
  7. isIncremental returns false
  8. + *
  9. getValue always returns the last set value in this session and only + * stores to memory
  10. + *
*/ @Named("default") @Singleton public class DefaultBuildContext implements BuildContext { + private final Map contextMap = new ConcurrentHashMap<>(); private final Logger logger = LoggerFactory.getLogger(DefaultBuildContext.class); /** {@inheritDoc} */ public boolean hasDelta(String relpath) { @@ -105,11 +112,12 @@ public boolean isIncremental() { /** {@inheritDoc} */ public Object getValue(String key) { - return null; + return contextMap.get(key); } /** {@inheritDoc} */ public void setValue(String key, Object value) { + contextMap.put(key, value); } private String getMessage(File file, int line, int column, String message) {