You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2022/01/23 16:56:59 UTC
[maven-build-cache-extension] branch master updated: [MBUILDCACHE-13] rename remote.cache.* properties to maven.build.cache.*
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-build-cache-extension.git
The following commit(s) were added to refs/heads/master by this push:
new 77abeca [MBUILDCACHE-13] rename remote.cache.* properties to maven.build.cache.*
77abeca is described below
commit 77abeca09e6104898106c4adf2bb315b423e5edf
Author: maximilian-novikov-db <ma...@gmail.com>
AuthorDate: Thu Jan 20 22:35:10 2022 +0300
[MBUILDCACHE-13] rename remote.cache.* properties to maven.build.cache.*
---
.../maven/buildcache/CacheControllerImpl.java | 6 ++---
.../buildcache/checksum/MavenProjectInput.java | 12 ++++-----
.../apache/maven/buildcache/xml/CacheConfig.java | 4 ++-
.../maven/buildcache/xml/CacheConfigImpl.java | 23 ++++++++++------
src/site/markdown/how-to.md | 2 +-
src/site/markdown/parameters.md | 31 +++++++++++-----------
src/site/markdown/performance.md | 4 +--
src/site/markdown/remote-cache.md | 4 +--
src/site/markdown/usage.md | 2 +-
9 files changed, 49 insertions(+), 39 deletions(-)
diff --git a/src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java b/src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java
index c25a98c..c9a7936 100644
--- a/src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java
+++ b/src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java
@@ -737,10 +737,10 @@ public class CacheControllerImpl implements CacheController
{
return true;
}
- String alwaysRunPlugins = project.getProperties().getProperty( "remote.cache.alwaysRunPlugins" );
- if ( alwaysRunPlugins != null )
+
+ if ( StringUtils.isNotBlank( cacheConfig.getAlwaysRunPlugins() ) )
{
- String[] alwaysRunPluginsList = split( alwaysRunPlugins, "," );
+ String[] alwaysRunPluginsList = split( cacheConfig.getAlwaysRunPlugins(), "," );
for ( String pluginAndGoal : alwaysRunPluginsList )
{
String[] tokens = pluginAndGoal.split( ":" );
diff --git a/src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java b/src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java
index 8799cd1..a717421 100644
--- a/src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java
+++ b/src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java
@@ -103,26 +103,26 @@ public class MavenProjectInput
/**
* property name to pass glob value. The glob to be used to list directory files in plugins scanning
*/
- private static final String CACHE_INPUT_GLOB_NAME = "remote.cache.input.glob";
+ private static final String CACHE_INPUT_GLOB_NAME = "maven.build.cache.input.glob";
/**
* default glob, bbsdk/abfx specific
*/
public static final String DEFAULT_GLOB = "{*.java,*.groovy,*.yaml,*.svcd,*.proto,*assembly.xml,assembly"
+ "*.xml,*logback.xml,*.vm,*.ini,*.jks,*.properties,*.sh,*.bat}";
/**
- * property name prefix to pass input files with project properties. smth like remote.cache.input.1 will be
+ * property name prefix to pass input files with project properties. smth like maven.build.cache.input.1 will be
* accepted
*/
- private static final String CACHE_INPUT_NAME = "remote.cache.input";
+ private static final String CACHE_INPUT_NAME = "maven.build.cache.input";
/**
- * property name prefix to exclude files from input. smth like remote.cache.exclude.1 should be set in project
+ * property name prefix to exclude files from input. smth like maven.build.cache.exclude.1 should be set in project
* props
*/
- private static final String CACHE_EXCLUDE_NAME = "remote.cache.exclude";
+ private static final String CACHE_EXCLUDE_NAME = "maven.build.cache.exclude";
/**
* Flag to control if we should check values from plugin configs as file system objects
*/
- private static final String CACHE_PROCESS_PLUGINS = "remote.cache.processPlugins";
+ private static final String CACHE_PROCESS_PLUGINS = "maven.build.cache.processPlugins";
private static final Logger LOGGER = LoggerFactory.getLogger( MavenProjectInput.class );
diff --git a/src/main/java/org/apache/maven/buildcache/xml/CacheConfig.java b/src/main/java/org/apache/maven/buildcache/xml/CacheConfig.java
index ab36f12..c3090c4 100644
--- a/src/main/java/org/apache/maven/buildcache/xml/CacheConfig.java
+++ b/src/main/java/org/apache/maven/buildcache/xml/CacheConfig.java
@@ -116,7 +116,7 @@ public interface CacheConfig
* allows safe to fallback ro normal execution in case of restore failure. Lazy policy restores artifacts on demand
* minimizing need for downloading any artifacts from cache
* <p>
- * Use: -Dremote.cache.lazyRestore=(true|false)
+ * Use: -Dmaven.build.cache.lazyRestore=(true|false)
*/
boolean isLazyRestore();
@@ -125,4 +125,6 @@ public interface CacheConfig
* scenarios
*/
boolean isRestoreGeneratedSources();
+
+ String getAlwaysRunPlugins();
}
diff --git a/src/main/java/org/apache/maven/buildcache/xml/CacheConfigImpl.java b/src/main/java/org/apache/maven/buildcache/xml/CacheConfigImpl.java
index e303393..bab8e15 100644
--- a/src/main/java/org/apache/maven/buildcache/xml/CacheConfigImpl.java
+++ b/src/main/java/org/apache/maven/buildcache/xml/CacheConfigImpl.java
@@ -77,14 +77,15 @@ import static org.apache.maven.buildcache.CacheUtils.getMultimoduleRoot;
public class CacheConfigImpl implements org.apache.maven.buildcache.xml.CacheConfig
{
- public static final String CONFIG_PATH_PROPERTY_NAME = "remote.cache.configPath";
- public static final String CACHE_ENABLED_PROPERTY_NAME = "remote.cache.enabled";
- public static final String SAVE_TO_REMOTE_PROPERTY_NAME = "remote.cache.save.enabled";
- public static final String SAVE_NON_OVERRIDEABLE_NAME = "remote.cache.save.final";
- public static final String FAIL_FAST_PROPERTY_NAME = "remote.cache.failFast";
- public static final String BASELINE_BUILD_URL_PROPERTY_NAME = "remote.cache.baselineUrl";
- public static final String LAZY_RESTORE_PROPERTY_NAME = "remote.cache.lazyRestore";
- public static final String RESTORE_GENERATED_SOURCES_PROPERTY_NAME = "remote.cache.restoreGeneratedSources";
+ public static final String CONFIG_PATH_PROPERTY_NAME = "maven.build.cache.configPath";
+ public static final String CACHE_ENABLED_PROPERTY_NAME = "maven.build.cache.enabled";
+ public static final String SAVE_TO_REMOTE_PROPERTY_NAME = "maven.build.cache.remote.save.enabled";
+ public static final String SAVE_NON_OVERRIDEABLE_NAME = "maven.build.cache.remote.save.final";
+ public static final String FAIL_FAST_PROPERTY_NAME = "maven.build.cache.failFast";
+ public static final String BASELINE_BUILD_URL_PROPERTY_NAME = "maven.build.cache.baselineUrl";
+ public static final String LAZY_RESTORE_PROPERTY_NAME = "maven.build.cache.lazyRestore";
+ public static final String RESTORE_GENERATED_SOURCES_PROPERTY_NAME = "maven.build.cache.restoreGeneratedSources";
+ public static final String ALWAYS_RUN_PLUGINS = "maven.build.cache.alwaysRunPlugins";
private static final Logger LOGGER = LoggerFactory.getLogger( CacheConfigImpl.class );
@@ -543,6 +544,12 @@ public class CacheConfigImpl implements org.apache.maven.buildcache.xml.CacheCon
}
@Override
+ public String getAlwaysRunPlugins()
+ {
+ return getProperty( ALWAYS_RUN_PLUGINS, null );
+ }
+
+ @Override
public String getId()
{
checkInitializedState();
diff --git a/src/site/markdown/how-to.md b/src/site/markdown/how-to.md
index 45bc3b1..579127d 100644
--- a/src/site/markdown/how-to.md
+++ b/src/site/markdown/how-to.md
@@ -216,5 +216,5 @@ git reset --hard
### I want to cache interim build and override it later with final version
-Solution: set `-Dremote.cache.save.final=true` to nodes which produce final builds. Such builds will not be overridden
+Solution: set `-Dmaven.build.cache.remote.save.final=true` to nodes which produce final builds. Such builds will not be overridden
and eventually will replace all interim builds
diff --git a/src/site/markdown/parameters.md b/src/site/markdown/parameters.md
index 8f3e3f7..74b1f0f 100644
--- a/src/site/markdown/parameters.md
+++ b/src/site/markdown/parameters.md
@@ -21,16 +21,17 @@ This documents contains various configuration parameters supported by cache engi
### Command line flags
-| Parameter | Description | Usage Scenario |
-| ----------- | ----------- | ----------- |
-| `-Dremote.cache.configPath=path to file` | Location of cache configuration file | Cache config is not in default location |
-| `-Dremote.cache.enabled=(true/false)` | Remote cache and associated features disabled/enabled | To remove noise from logs then remote cache is not available |
-| `-Dremote.cache.save.enabled=(true/false)` | Remote cache save allowed or not | To designate nodes which allowed to push in remote shared cache |
-| `-Dremote.cache.save.final=(true/false)` | Prohibit to override remote cache | To ensure that reference build is not overridden by interim build |
-| `-Dremote.cache.failFast=(true/false)` | Fail on the first module which cannot be restored from cache | Remote cache setup/tuning/troubleshooting |
-| `-Dremote.cache.baselineUrl=<http url>` | Location of baseline build for comparison | Remote cache setup/tuning/troubleshooting |
-| `-Dremote.cache.lazyRestore=(true/false)` | Restore artifacts from remote cache lazily | Performance optimization |
-| `-Dremote.cache.restoreGeneratedSources=(true/false)` | Do not restore generated sources and directly attached files | Performance optimization |
+| Parameter | Description | Usage Scenario |
+|------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------| ----------- |
+| `-Dmaven.build.cache.configPath=path to file` | Location of cache configuration file | Cache config is not in default location |
+| `-Dmaven.build.cache.enabled=(true/false)` | Cache and associated features disabled/enabled | To remove noise from logs then remote cache is not available |
+| `-Dmaven.build.cache.remote.save.enabled=(true/false)` | Remote cache save allowed or not | To designate nodes which allowed to push in remote shared cache |
+| `-Dmaven.build.cache.remote.save.final=(true/false)` | Prohibit to override remote cache | To ensure that reference build is not overridden by interim build |
+| `-Dmaven.build.cache.failFast=(true/false)` | Fail on the first module which cannot be restored from cache | Remote cache setup/tuning/troubleshooting |
+| `-Dmaven.build.cache.baselineUrl=<http url>` | Location of baseline build for comparison | Remote cache setup/tuning/troubleshooting |
+| `-Dmaven.build.cache.lazyRestore=(true/false)` | Restore artifacts from remote cache lazily | Performance optimization |
+| `-Dmaven.build.cache.restoreGeneratedSources=(true/false)` | Do not restore generated sources and directly attached files | Performance optimization |
+| `-Dmaven.build.cache.alwaysRunPlugins=<list of plugins>` | Comma seprated list of plugins to always run regardless of cache state. An example: `maven-deploy-plugin:*,maven-install-plugin:install` | Remote cache setup/tuning/troubleshooting |
### Project level properties
@@ -40,14 +41,14 @@ Project level parameters allow overriding global parameters on project level Mus
<pom>
...
<properties>
- <remote.cache.input.glob>{*.css}</remote.cache.input.glob>
+ <maven.build.cache.input.glob>{*.css}</maven.build.cache.input.glob>
</properties>
</pom>
```
| Parameter | Description |
| ----------------------------- | ----------- |
-| `remote.cache.input.glob` | Project specific glob to select sources. Overrides global glob. |
-| `remote.cache.input` | Property prefix to mark paths which must be additionally scanned for source code. Value of property starting with this prefix will be treated as path relatively to current project/module |
-| `remote.cache.exclude` | Property prefix to mark paths which must be excluded from source code search. Value of property starting with this prefix will be treated as path to current project/module |
-| `remote.cache.processPlugins` | Introspect plugins to find inputs or not. Default is true. |
+| `maven.build.cache.input.glob` | Project specific glob to select sources. Overrides global glob. |
+| `maven.build.cache.input` | Property prefix to mark paths which must be additionally scanned for source code. Value of property starting with this prefix will be treated as path relatively to current project/module |
+| `maven.build.cache.exclude` | Property prefix to mark paths which must be excluded from source code search. Value of property starting with this prefix will be treated as path to current project/module |
+| `maven.build.cache.processPlugins` | Introspect plugins to find inputs or not. Default is true. |
diff --git a/src/site/markdown/performance.md b/src/site/markdown/performance.md
index 22b409d..e8e3523 100644
--- a/src/site/markdown/performance.md
+++ b/src/site/markdown/performance.md
@@ -66,7 +66,7 @@ and resources wins for remote cache by avoiding requesting and downloading unnec
line flag:
```
--Dremote.cache.lazyRestore=true";
+-Dmaven.build.cache.lazyRestore=true";
```
Note: In case of cache corruption lazy cache cannot fallback to normal execution, it will fail instead. To heal the
@@ -79,7 +79,7 @@ depending on configuration). This could be helpful in local environment, but lik
continuous integration. To disable add command line flag
```
--Dremote.cache.restoreGeneratedSources=false";
+-Dmaven.build.cache.restoreGeneratedSources=false";
```
### Disable post-processing of archives(JARs, WARs, etc) META-INF
diff --git a/src/site/markdown/remote-cache.md b/src/site/markdown/remote-cache.md
index c7fa16d..fa35ff6 100644
--- a/src/site/markdown/remote-cache.md
+++ b/src/site/markdown/remote-cache.md
@@ -84,7 +84,7 @@ normally.
Allow writes in remote cache add jvm property to designated CI builds.
```
--Dremote.cache.save.enabled=true
+-Dmaven.build.cache.remote.save.enabled=true
```
Run the build, review log and ensure that artifacts are uploaded to remote cache. Now, rerun build and ensure that it
@@ -111,7 +111,7 @@ Copy the link to a `cbuild-ache-report.xml` and provide it to your local build a
* Run local build. Command line should look similar to this:
```bash
-mvn verify -Dremote.cache.failFast=true -Dremote.cache.baselineUrl=https://your-cache-url/<...>/915296a3-4596-4eb5-bf37-f6e13ebe087e/build-cache-report.xml
+mvn verify -Dmaven.build.cache.failFast=true -Dmaven.build.cache.baselineUrl=https://your-cache-url/<...>/915296a3-4596-4eb5-bf37-f6e13ebe087e/build-cache-report.xml
```
Once discrepancy between remote and local builds detected cache will fail with diagnostic info in
diff --git a/src/site/markdown/usage.md b/src/site/markdown/usage.md
index ef81487..f066d45 100644
--- a/src/site/markdown/usage.md
+++ b/src/site/markdown/usage.md
@@ -43,7 +43,7 @@ Disable in config:
```
On command line:
```
--Dremote.cache.enabled=false
+-Dmaven.build.cache.enabled=false
```
## IDE support