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 2021/11/06 17:23:25 UTC
[maven] 03/04: Use plurals in the schema,
make sure it can read things correctly
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch MNG-7129_Modello
in repository https://gitbox.apache.org/repos/asf/maven.git
commit ca9bce42f72568150c6f5fab3f04384242086191
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Fri Nov 5 14:59:32 2021 +0100
Use plurals in the schema, make sure it can read things correctly
---
maven-core/pom.xml | 1 +
.../apache/maven/caching/PluginScanConfigImpl.java | 16 +-
.../maven/caching/checksum/MavenProjectInput.java | 6 +-
.../apache/maven/caching/hash/CloseableBuffer.java | 21 +-
.../java/org/apache/maven/caching/hash/XXMM.java | 4 +-
.../org/apache/maven/caching/xml/CacheConfig.java | 3 +-
.../apache/maven/caching/xml/CacheConfigImpl.java | 37 +-
.../org/apache/maven/caching/xml/XmlService.java | 35 +-
maven-core/src/main/mdo/cache-config.mdo | 61 +-
maven-core/src/main/mdo/cache-diff.mdo | 2 +-
maven-core/src/main/mdo/cache-report.mdo | 2 +-
.../src/main/resources/cache-config-instance.xml | 112 ----
maven-core/src/main/resources/cache-config.xsd | 640 ---------------------
maven-core/src/main/resources/cache-domain.xsd | 187 ------
.../apache/maven/caching/xml/CacheConfigTest.java | 8 +-
.../maven/caching/xml/cache-config-instance.xml | 160 ++++++
.../maven/caching/xml}/cache-domain-instance.xml | 0
17 files changed, 259 insertions(+), 1036 deletions(-)
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index bdd5543..5ff2215 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -246,6 +246,7 @@ under the License.
<model>src/main/mdo/cache-diff.mdo</model>
<model>src/main/mdo/cache-report.mdo</model>
</models>
+ <outputDirectory>${basedir}/target/generated-sources/modello</outputDirectory>
</configuration>
</execution>
<execution>
diff --git a/maven-core/src/main/java/org/apache/maven/caching/PluginScanConfigImpl.java b/maven-core/src/main/java/org/apache/maven/caching/PluginScanConfigImpl.java
index e95342c..1c5ea65 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/PluginScanConfigImpl.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/PluginScanConfigImpl.java
@@ -52,13 +52,13 @@ public class PluginScanConfigImpl implements PluginScanConfig
// include or exclude is a choice element, could be only obe property set
//noinspection ConstantConditions
- final List<TagScanConfigType> includes = dto.getInclude();
+ final List<TagScanConfigType> includes = dto.getIncludes();
if ( !includes.isEmpty() )
{
return findTagScanProperties( tagName ) != null;
}
- return !contains( dto.getExclude(), tagName );
+ return !contains( dto.getExcludes(), tagName );
}
private boolean contains( List<TagNameType> excludes, String tagName )
@@ -104,11 +104,11 @@ public class PluginScanConfigImpl implements PluginScanConfig
merged.setMode( dto.getMode() );
}
- merged.getExclude().addAll( dto.getExclude() );
- merged.getExclude().addAll( override.getExclude() );
+ merged.getExcludes().addAll( dto.getExcludes() );
+ merged.getExcludes().addAll( override.getExcludes() );
- merged.getInclude().addAll( dto.getInclude() );
- merged.getInclude().addAll( override.getInclude() );
+ merged.getIncludes().addAll( dto.getIncludes() );
+ merged.getIncludes().addAll( override.getIncludes() );
return new PluginScanConfigImpl( merged );
}
@@ -128,10 +128,10 @@ public class PluginScanConfigImpl implements PluginScanConfig
private ScanConfigProperties findTagScanProperties( String tagName )
{
- ScanConfigProperties scanConfigProperties = findConfigByName( tagName, dto.getInclude() );
+ ScanConfigProperties scanConfigProperties = findConfigByName( tagName, dto.getIncludes() );
if ( scanConfigProperties == null )
{
- scanConfigProperties = findConfigByName( tagName, dto.getTagScanConfig() );
+ scanConfigProperties = findConfigByName( tagName, dto.getTagScanConfigs() );
}
return scanConfigProperties;
}
diff --git a/maven-core/src/main/java/org/apache/maven/caching/checksum/MavenProjectInput.java b/maven-core/src/main/java/org/apache/maven/caching/checksum/MavenProjectInput.java
index ca78ada..56fbaed 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/checksum/MavenProjectInput.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/checksum/MavenProjectInput.java
@@ -33,6 +33,7 @@ import org.apache.maven.caching.PluginScanConfig;
import org.apache.maven.caching.ProjectUtils;
import org.apache.maven.caching.RemoteArtifactsRepository;
import org.apache.maven.caching.ScanConfigProperties;
+import org.apache.maven.caching.domain.Exclude;
import org.apache.maven.caching.hash.HashAlgorithm;
import org.apache.maven.caching.hash.HashChecksum;
import org.apache.maven.caching.hash.HashFactory;
@@ -179,9 +180,10 @@ public class MavenProjectInput
filteredOutPaths = new ArrayList<>( Arrays.asList( normalizedPath( build.getDirectory() ), // target by default
normalizedPath( build.getOutputDirectory() ), normalizedPath( build.getTestOutputDirectory() ) ) );
- for ( String excludePath : config.getGlobalExcludePaths() )
+ List<Exclude> excludes = config.getGlobalExcludePaths();
+ for ( Exclude excludePath : excludes )
{
- filteredOutPaths.add( Paths.get( excludePath ) );
+ filteredOutPaths.add( Paths.get( excludePath.getValue() ) );
}
for ( String propertyName : properties.stringPropertyNames() )
diff --git a/maven-core/src/main/java/org/apache/maven/caching/hash/CloseableBuffer.java b/maven-core/src/main/java/org/apache/maven/caching/hash/CloseableBuffer.java
index 0fec364..91acdf2 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/hash/CloseableBuffer.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/hash/CloseableBuffer.java
@@ -35,22 +35,21 @@ import static org.apache.maven.caching.hash.ReflectionUtils.getMethod;
*/
public class CloseableBuffer implements AutoCloseable
{
- /* Java 8
- private static final Cleaner CLEANER = doPrivileged((PrivilegedAction<Cleaner>) () -> {
- final boolean isOldJava = System.getProperty("java.specification.version", "9").startsWith("1.");
- if (isOldJava) {
- return DirectCleaner.isSupported() ? new DirectCleaner() : new NoopCleaner();
- } else {
- return UnsafeCleaner.isSupported() ? new UnsafeCleaner() : new NoopCleaner();
- }
- });
- */
+
private static final Cleaner CLEANER = doPrivileged( new PrivilegedAction<Cleaner>()
{
@Override
public Cleaner run()
{
- return DirectCleaner.isSupported() ? new DirectCleaner() : new NoopCleaner();
+ final String jsv = System.getProperty( "java.specification.version", "9" );
+ if ( jsv.startsWith( "1." ) )
+ {
+ return DirectCleaner.isSupported() ? new DirectCleaner() : new NoopCleaner();
+ }
+ else
+ {
+ return UnsafeCleaner.isSupported() ? new UnsafeCleaner() : new NoopCleaner();
+ }
}
} );
diff --git a/maven-core/src/main/java/org/apache/maven/caching/hash/XXMM.java b/maven-core/src/main/java/org/apache/maven/caching/hash/XXMM.java
index 8e09299..7afe240 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/hash/XXMM.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/hash/XXMM.java
@@ -57,8 +57,8 @@ public class XXMM implements Hash.Factory
@Override
public byte[] hash( Path path ) throws IOException
{
- try ( FileChannel channel = FileChannel.open( path,
- READ ); CloseableBuffer buffer = CloseableBuffer.mappedBuffer( channel, READ_ONLY ) )
+ try ( FileChannel channel = FileChannel.open( path, READ );
+ CloseableBuffer buffer = CloseableBuffer.mappedBuffer( channel, READ_ONLY ) )
{
return toByteArray( XX.INSTANCE.hashBytes( buffer.getBuffer() ) );
}
diff --git a/maven-core/src/main/java/org/apache/maven/caching/xml/CacheConfig.java b/maven-core/src/main/java/org/apache/maven/caching/xml/CacheConfig.java
index e07ce6a..a9dd950 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/xml/CacheConfig.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/xml/CacheConfig.java
@@ -21,6 +21,7 @@ package org.apache.maven.caching.xml;
import org.apache.maven.caching.PluginScanConfig;
import org.apache.maven.caching.checksum.MultimoduleDiscoveryStrategy;
+import org.apache.maven.caching.domain.Exclude;
import org.apache.maven.caching.hash.HashFactory;
import org.apache.maven.caching.domain.Include;
import org.apache.maven.caching.domain.PropertyNameType;
@@ -65,7 +66,7 @@ public interface CacheConfig
List<Include> getGlobalIncludePaths();
@Nonnull
- List<String> getGlobalExcludePaths();
+ List<Exclude> getGlobalExcludePaths();
@Nonnull
PluginScanConfig getPluginDirScanConfig( Plugin plugin );
diff --git a/maven-core/src/main/java/org/apache/maven/caching/xml/CacheConfigImpl.java b/maven-core/src/main/java/org/apache/maven/caching/xml/CacheConfigImpl.java
index 7946942..137bcc6 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/xml/CacheConfigImpl.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/xml/CacheConfigImpl.java
@@ -27,6 +27,7 @@ import org.apache.maven.caching.PluginScanConfig;
import org.apache.maven.caching.PluginScanConfigImpl;
import org.apache.maven.caching.checksum.MultimoduleDiscoveryStrategy;
import org.apache.maven.caching.domain.AttachedOutputs;
+import org.apache.maven.caching.domain.Exclude;
import org.apache.maven.caching.domain.Include;
import org.apache.maven.caching.domain.Local;
import org.apache.maven.caching.domain.ProjectDiscoveryStrategy;
@@ -190,7 +191,7 @@ public class CacheConfigImpl implements CacheConfig
final GoalReconciliationType reconciliationConfig = findReconciliationConfig( mojoExecution );
if ( reconciliationConfig != null )
{
- return reconciliationConfig.getReconcile();
+ return reconciliationConfig.getReconciles();
}
else
{
@@ -224,7 +225,7 @@ public class CacheConfigImpl implements CacheConfig
return null;
}
- final List<GoalReconciliationType> reconciliation = executionControl.getReconcile().getPlugin();
+ final List<GoalReconciliationType> reconciliation = executionControl.getReconcile().getPlugins();
for ( GoalReconciliationType goalReconciliationConfig : reconciliation )
{
@@ -249,7 +250,7 @@ public class CacheConfigImpl implements CacheConfig
final GoalReconciliationType reconciliationConfig = findReconciliationConfig( mojoExecution );
if ( reconciliationConfig != null )
{
- return reconciliationConfig.getLog();
+ return reconciliationConfig.getLogs();
}
else
{
@@ -265,7 +266,7 @@ public class CacheConfigImpl implements CacheConfig
final GoalReconciliationType reconciliationConfig = findReconciliationConfig( mojoExecution );
if ( reconciliationConfig != null )
{
- return reconciliationConfig.getNolog();
+ return reconciliationConfig.getNologs();
}
else
{
@@ -282,7 +283,7 @@ public class CacheConfigImpl implements CacheConfig
if ( pluginConfig != null && pluginConfig.getEffectivePom() != null )
{
- return pluginConfig.getEffectivePom().getExcludeProperty();
+ return pluginConfig.getEffectivePom().getExcludeProperties();
}
return Collections.emptyList();
}
@@ -295,7 +296,7 @@ public class CacheConfigImpl implements CacheConfig
return null;
}
- final List<PluginConfigurationScanType> pluginConfigs = cacheConfig.getInput().getPlugin();
+ final List<PluginConfigurationScanType> pluginConfigs = cacheConfig.getInput().getPlugins();
for ( PluginConfigurationScanType pluginConfig : pluginConfigs )
{
if ( isPluginMatch( plugin, pluginConfig ) )
@@ -338,7 +339,7 @@ public class CacheConfigImpl implements CacheConfig
if ( pluginScanConfig != null )
{
final ExecutionConfigurationScanType executionScanConfig = findExecutionScanConfig( exec,
- pluginScanConfig.getExecution() );
+ pluginScanConfig.getExecutions() );
if ( executionScanConfig != null && executionScanConfig.getDirScan() != null )
{
return new PluginScanConfigImpl( executionScanConfig.getDirScan() );
@@ -353,7 +354,7 @@ public class CacheConfigImpl implements CacheConfig
{
for ( ExecutionConfigurationScanType executionScanConfig : scanConfigs )
{
- if ( executionScanConfig.getExecId().contains( execution.getId() ) )
+ if ( executionScanConfig.getExecIds().contains( execution.getId() ) )
{
return executionScanConfig;
}
@@ -380,15 +381,15 @@ public class CacheConfigImpl implements CacheConfig
public List<Include> getGlobalIncludePaths()
{
checkInitializedState();
- return cacheConfig.getInput().getGlobal().getInclude();
+ return cacheConfig.getInput().getGlobal().getIncludes();
}
@Nonnull
@Override
- public List<String> getGlobalExcludePaths()
+ public List<Exclude> getGlobalExcludePaths()
{
checkInitializedState();
- return cacheConfig.getInput().getGlobal().getExclude();
+ return cacheConfig.getInput().getGlobal().getExcludes();
}
@Nonnull
@@ -439,7 +440,7 @@ public class CacheConfigImpl implements CacheConfig
private boolean executionMatches( MojoExecution execution, ExecutablesType executablesType )
{
- final List<PluginSetType> pluginConfigs = executablesType.getPlugin();
+ final List<PluginSetType> pluginConfigs = executablesType.getPlugins();
for ( PluginSetType pluginConfig : pluginConfigs )
{
if ( isPluginMatch( execution.getPlugin(), pluginConfig ) )
@@ -448,20 +449,20 @@ public class CacheConfigImpl implements CacheConfig
}
}
- final List<ExecutionIdsListType> executionIds = executablesType.getExecution();
+ final List<ExecutionIdsListType> executionIds = executablesType.getExecutions();
for ( ExecutionIdsListType executionConfig : executionIds )
{
- if ( isPluginMatch( execution.getPlugin(), executionConfig ) && executionConfig.getExecId().contains(
+ if ( isPluginMatch( execution.getPlugin(), executionConfig ) && executionConfig.getExecIds().contains(
execution.getExecutionId() ) )
{
return true;
}
}
- final List<GoalsListType> pluginsGoalsList = executablesType.getGoals();
+ final List<GoalsListType> pluginsGoalsList = executablesType.getGoalsLists();
for ( GoalsListType pluginGoals : pluginsGoalsList )
{
- if ( isPluginMatch( execution.getPlugin(), pluginGoals ) && pluginGoals.getGoal().contains(
+ if ( isPluginMatch( execution.getPlugin(), pluginGoals ) && pluginGoals.getGoals().contains(
execution.getGoal() ) )
{
return true;
@@ -536,7 +537,7 @@ public class CacheConfigImpl implements CacheConfig
{
checkInitializedState();
final AttachedOutputs attachedOutputs = getConfiguration().getAttachedOutputs();
- return attachedOutputs == null ? Collections.<String>emptyList() : attachedOutputs.getDirName();
+ return attachedOutputs == null ? Collections.<String>emptyList() : attachedOutputs.getDirNames();
}
@Nonnull
@@ -552,7 +553,7 @@ public class CacheConfigImpl implements CacheConfig
if ( cacheConfig.getOutput() != null && cacheConfig.getOutput().getExclude() != null )
{
List<Pattern> patterns = new ArrayList<>();
- for ( String pattern : cacheConfig.getOutput().getExclude().getPattern() )
+ for ( String pattern : cacheConfig.getOutput().getExclude().getPatterns() )
{
patterns.add( Pattern.compile( pattern ) );
}
diff --git a/maven-core/src/main/java/org/apache/maven/caching/xml/XmlService.java b/maven-core/src/main/java/org/apache/maven/caching/xml/XmlService.java
index f63ffe6..6419c8f 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/xml/XmlService.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/xml/XmlService.java
@@ -38,6 +38,7 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.nio.file.Files;
/**
@@ -85,47 +86,33 @@ public class XmlService
public <T> T fromFile( Class<T> clazz, File file ) throws IOException, XmlPullParserException
{
- if ( clazz == BuildInfoType.class )
- {
- return clazz.cast( new CacheDomainXpp3Reader().read( Files.newInputStream( file.toPath() ) ) );
- }
- else if ( clazz == CacheType.class )
- {
- return clazz.cast( new CacheConfigXpp3Reader().read( Files.newInputStream( file.toPath() ) ) );
- }
- else if ( clazz == BuildDiffType.class )
- {
- return clazz.cast( new CacheDiffXpp3Reader().read( Files.newInputStream( file.toPath() ) ) );
- }
- else if ( clazz == CacheReportType.class )
- {
- return clazz.cast( new CacheReportXpp3Reader().read( Files.newInputStream( file.toPath() ) ) );
- }
- else
- {
- throw new IllegalArgumentException( "Unsupported type " + clazz );
- }
+ return fromInputStream( clazz, Files.newInputStream( file.toPath() ) );
}
public <T> T fromBytes( Class<T> clazz, byte[] bytes )
{
+ return fromInputStream( clazz, new ByteArrayInputStream( bytes ) );
+ }
+
+ public <T> T fromInputStream( Class<T> clazz, InputStream inputStream )
+ {
try
{
if ( clazz == BuildInfoType.class )
{
- return clazz.cast( new CacheDomainXpp3Reader().read( new ByteArrayInputStream( bytes ) ) );
+ return clazz.cast( new CacheDomainXpp3Reader().read( inputStream ) );
}
else if ( clazz == CacheType.class )
{
- return clazz.cast( new CacheConfigXpp3Reader().read( new ByteArrayInputStream( bytes ) ) );
+ return clazz.cast( new CacheConfigXpp3Reader().read( inputStream ) );
}
else if ( clazz == BuildDiffType.class )
{
- return clazz.cast( new CacheDiffXpp3Reader().read( new ByteArrayInputStream( bytes ) ) );
+ return clazz.cast( new CacheDiffXpp3Reader().read( inputStream ) );
}
else if ( clazz == CacheReportType.class )
{
- return clazz.cast( new CacheReportXpp3Reader().read( new ByteArrayInputStream( bytes ) ) );
+ return clazz.cast( new CacheReportXpp3Reader().read( inputStream ) );
}
else
{
diff --git a/maven-core/src/main/mdo/cache-config.mdo b/maven-core/src/main/mdo/cache-config.mdo
index dfd4bf6..5160bb8 100644
--- a/maven-core/src/main/mdo/cache-config.mdo
+++ b/maven-core/src/main/mdo/cache-config.mdo
@@ -76,7 +76,7 @@ under the License.
</xs:sequence>
</xs:complexType>
-->
- <class rootElement="true">
+ <class rootElement="true" xml.tagName="cache">
<name>CacheType</name>
<fields>
<field>
@@ -320,7 +320,7 @@ under the License.
</association>
</field>
<field>
- <name>debug</name>
+ <name>debugs</name>
<association>
<type>String</type>
<multiplicity>*</multiplicity>
@@ -376,7 +376,7 @@ under the License.
<name>AttachedOutputs</name>
<fields>
<field>
- <name>dirName</name>
+ <name>dirNames</name>
<association>
<type>String</type>
<multiplicity>*</multiplicity>
@@ -445,7 +445,7 @@ under the License.
<description>Global input calculation rules applicable to all projects and plugins in the build</description>
</field>
<field>
- <name>plugin</name>
+ <name>plugins</name>
<association>
<type>PluginConfigurationScanType</type>
<multiplicity>*</multiplicity>
@@ -520,7 +520,7 @@ under the License.
<description>Specifies plugin level rules of configuration processing in search of referenced source files</description>
</field>
<field>
- <name>execution</name>
+ <name>executions</name>
<association>
<type>ExecutionConfigurationScanType</type>
<multiplicity>*</multiplicity>
@@ -548,7 +548,7 @@ under the License.
<name>EffectivePom</name>
<fields>
<field>
- <name>excludeProperty</name>
+ <name>excludeProperties</name>
<association>
<type>String</type>
<multiplicity>*</multiplicity>
@@ -583,7 +583,7 @@ under the License.
<name>ExecutionConfigurationScanType</name>
<fields>
<field>
- <name>execId</name>
+ <name>execIds</name>
<association>
<type>String</type>
<multiplicity>*</multiplicity>
@@ -694,7 +694,7 @@ under the License.
<name>DirScanConfigType</name>
<fields>
<field>
- <name>include</name>
+ <name>includes</name>
<association>
<type>TagScanConfigType</type>
<multiplicity>*</multiplicity>
@@ -703,7 +703,7 @@ under the License.
properties will be takein in calculation (whitelist)</description>
</field>
<field>
- <name>exclude</name>
+ <name>excludes</name>
<association>
<type>TagNameType</type>
<multiplicity>*</multiplicity>
@@ -711,7 +711,7 @@ under the License.
<description>Tag to exclude when scanning plugin configuration for input files (blacklist)</description>
</field>
<field>
- <name>tagScanConfig</name>
+ <name>tagScanConfigs</name>
<association>
<type>TagScanConfigType</type>
<multiplicity>*</multiplicity>
@@ -769,7 +769,7 @@ under the License.
<name>OutputTypeExclude</name>
<fields>
<field>
- <name>pattern</name>
+ <name>patterns</name>
<association>
<type>String</type>
<multiplicity>*</multiplicity>
@@ -804,22 +804,31 @@ under the License.
<defaultValue>*</defaultValue>
</field>
<field>
- <name>include</name>
+ <name>includes</name>
<association>
<type>Include</type>
<multiplicity>*</multiplicity>
</association>
</field>
<field>
- <name>exclude</name>
+ <name>excludes</name>
<association>
- <type>String</type>
+ <type>Exclude</type>
<multiplicity>*</multiplicity>
</association>
</field>
</fields>
</class>
<class>
+ <name>Exclude</name>
+ <fields>
+ <field xml.content="true">
+ <name>value</name>
+ <type>String</type>
+ </field>
+ </fields>
+ </class>
+ <class>
<name>Include</name>
<fields>
<field xml.content="true">
@@ -901,14 +910,14 @@ under the License.
<superClass>GoalIdType</superClass>
<fields>
<field>
- <name>reconcile</name>
+ <name>reconciles</name>
<association>
<type>TrackedPropertyType</type>
<multiplicity>*</multiplicity>
</association>
</field>
<field>
- <name>log</name>
+ <name>logs</name>
<association>
<type>PropertyNameType</type>
<multiplicity>*</multiplicity>
@@ -916,7 +925,7 @@ under the License.
<description>Specify property which should be logged to build metadata for exploration</description>
</field>
<field>
- <name>nolog</name>
+ <name>nologs</name>
<association>
<type>PropertyNameType</type>
<multiplicity>*</multiplicity>
@@ -1057,7 +1066,7 @@ under the License.
<name>Reconcile</name>
<fields>
<field>
- <name>plugin</name>
+ <name>plugins</name>
<association>
<type>GoalReconciliationType</type>
<multiplicity>*</multiplicity>
@@ -1113,7 +1122,7 @@ under the License.
<name>ExecutablesType</name>
<fields>
<field>
- <name>plugin</name>
+ <name>plugins</name>
<association>
<type>PluginSetType</type>
<multiplicity>*</multiplicity>
@@ -1121,7 +1130,7 @@ under the License.
<description>Specify which executions should run always if present in build regardless of cached status</description>
</field>
<field>
- <name>execution</name>
+ <name>executions</name>
<association>
<type>ExecutionIdsListType</type>
<multiplicity>*</multiplicity>
@@ -1129,7 +1138,7 @@ under the License.
<description>Specify which executions should run always if present in build regardless of cached status</description>
</field>
<field>
- <name>goals</name>
+ <name>goalsLists</name>
<association>
<type>GoalsListType</type>
<multiplicity>*</multiplicity>
@@ -1162,7 +1171,7 @@ under the License.
<superClass>CoordinatesBaseType</superClass>
<fields>
<field>
- <name>goal</name>
+ <name>goals</name>
<association>
<type>String</type>
<multiplicity>*</multiplicity>
@@ -1217,7 +1226,7 @@ under the License.
<superClass>CoordinatesBaseType</superClass>
<fields>
<field>
- <name>execId</name>
+ <name>execIds</name>
<association>
<type>String</type>
<multiplicity>*</multiplicity>
@@ -1250,11 +1259,11 @@ under the License.
<class>
<name>CoordinatesBaseType</name>
<fields>
- <field>
+ <field xml.attribute="true">
<name>groupId</name>
<type>String</type>
</field>
- <field>
+ <field xml.attribute="true">
<name>artifactId</name>
<type>String</type>
</field>
@@ -1274,7 +1283,7 @@ under the License.
<class>
<name>TagNameType</name>
<fields>
- <field>
+ <field xml.attribute="true">
<name>tagName</name>
<type>String</type>
<required>true</required>
diff --git a/maven-core/src/main/mdo/cache-diff.mdo b/maven-core/src/main/mdo/cache-diff.mdo
index e2a9cfe..d9c3d18 100644
--- a/maven-core/src/main/mdo/cache-diff.mdo
+++ b/maven-core/src/main/mdo/cache-diff.mdo
@@ -19,7 +19,7 @@ under the License.
<model xmlns="http://codehaus-plexus.github.io/MODELLO/1.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/1.4.0 http://codehaus-plexus.github.io/modello/xsd/modello-1.4.0.xsd"
- xsd.namespace="org:apache:maven:cache:domain">
+ xsd.namespace="org:apache:maven:cache:diff">
<id>cache-diff</id>
<name>CacheDiff</name>
<description><![CDATA[
diff --git a/maven-core/src/main/mdo/cache-report.mdo b/maven-core/src/main/mdo/cache-report.mdo
index d081946..3e7b8f3 100644
--- a/maven-core/src/main/mdo/cache-report.mdo
+++ b/maven-core/src/main/mdo/cache-report.mdo
@@ -19,7 +19,7 @@ under the License.
<model xmlns="http://codehaus-plexus.github.io/MODELLO/1.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/1.4.0 http://codehaus-plexus.github.io/modello/xsd/modello-1.4.0.xsd"
- xsd.namespace="org:apache:maven:cache:domain">
+ xsd.namespace="org:apache:maven:cache:report">
<id>cache-report</id>
<name>CacheReport</name>
<description><![CDATA[
diff --git a/maven-core/src/main/resources/cache-config-instance.xml b/maven-core/src/main/resources/cache-config-instance.xml
deleted file mode 100644
index 6855592..0000000
--- a/maven-core/src/main/resources/cache-config-instance.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<!--
-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.
--->
-
-<cache xmlns="org:apache:maven:cache:config:v1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="org:apache:maven:cache:config:v1 cache-config.xsd">
-
- <configuration>
- <enabled>true</enabled>
- <hashAlgorithm>SHA-256</hashAlgorithm>
- <validateXml>true</validateXml>
- <remote>
- <url>http://host:port</url>
- </remote>
- <local>
- <maxBuildsCached>3</maxBuildsCached>
- </local>
- </configuration>
-
- <input>
- <global>
- <glob>
- {*.java,*.groovy,*.yaml,*.svcd,*.proto,*assembly.xml,assembly*.xml,*logback.xml,*.vm,*.ini,*.jks,*.properties,*.sh,*.bat}
- </glob>
- <include>src/</include>
- <exclude>pom.xml</exclude>
- </global>
- <plugin artifactId="bb-sdk-codegen">
- <effectivePom>
- <excludeProperty>111</excludeProperty>
- </effectivePom>
- <dirScan mode="auto">
- <exclude tagName="outputDirectory"/>
- <exclude tagName="directory"/>
- <tagScanConfig tagName="someProperty" glob="*.java" recursive="false"/>
- </dirScan>
- <execution>
- <execId>1</execId>
- <execId>2</execId>
- <dirScan mode="auto">
- <include tagName="protolocation" recursive="false" glob="*.proto"/>
- </dirScan>
- </execution>
- </plugin>
- </input>
- <output>
- <exclude>
- <pattern>.*-processes.*\.zip</pattern>
- </exclude>
- </output>
- <executionControl>
- <runAlways>
- <plugin artifactId="maven-failsafe-plugin"/>
- <execution artifactId="maven-deploy-plugin">
- <execId>aaa</execId>
- </execution>
- <goals artifactId="maven-install-plugin">
- <goal>install</goal>
- </goals>
- <goals artifactId="maven-deploy-plugin">
- <goal>deploy</goal>
- </goals>
- <goals artifactId="bb-sdk-codegen">
- <goal>deploy-local</goal>
- </goals>
- </runAlways>
- <ignoreMissing>
- <plugin artifactId="maven-deploy-plugin"/>
- <plugin artifactId="maven-install-plugin"/>
- </ignoreMissing>
- <reconcile logAllProperties="true">
- <plugin artifactId="maven-compiler-plugin" goal="compile">
- <reconcile propertyName="source"/>
- <reconcile propertyName="target"/>
- <reconcile propertyName="debug"/>
- <reconcile propertyName="debuglevel"/>
- <!-- whitelist of logged properties-->
- <log propertyName="includes"/>
- <log propertyName="excludes"/>
- <log propertyName="argLine"/>
- </plugin>
- <plugin artifactId="duplicate-finder-maven-plugin" goal="check">
- <reconcile propertyName="skip" skipValue="true"/>
- <reconcile propertyName="quiet" skipValue="true"/>
- </plugin>
- <plugin artifactId="maven-enforcer-plugin" goal="enforce">
- <reconcile propertyName="skip" skipValue="true"/>
- <!-- blacklisted from logging properties-->
- <nolog propertyName="redundantProperty"/>
- <nolog propertyName="redundantProperty2"/>
- </plugin>
- </reconcile>
- </executionControl>
-</cache>
diff --git a/maven-core/src/main/resources/cache-config.xsd b/maven-core/src/main/resources/cache-config.xsd
deleted file mode 100644
index 69437d9..0000000
--- a/maven-core/src/main/resources/cache-config.xsd
+++ /dev/null
@@ -1,640 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<!--
-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.
--->
-
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:c="org:apache:maven:cache:config:v1"
- xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
- jxb:version="1.0"
- elementFormDefault="qualified"
- targetNamespace="org:apache:maven:cache:config:v1">
-
- <xs:annotation>
- <xs:appinfo>
- <jxb:globalBindings optionalProperty="isSet"/>
- <jxb:schemaBindings>
- <jxb:package name="org.apache.maven.caching.jaxb.config"/>
- </jxb:schemaBindings>
- </xs:appinfo>
- </xs:annotation>
-
- <xs:element name="cache" type="c:CacheType">
- <xs:annotation>
- <xs:documentation>
- Cached build metadata
- </xs:documentation>
- </xs:annotation>
- </xs:element>
-
- <xs:complexType name="CacheType">
- <xs:sequence>
- <xs:element name="configuration" type="c:ConfigurationType">
- <xs:annotation>
- <xs:documentation>
- Configuration of major cache properties
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="input" type="c:InputType">
- <xs:annotation>
- <xs:documentation>
- Configuration for source code input files participating in checksum calculation
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="output" type="c:OutputType" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- Configuration for output artifacts, it's needed if you want to explicitly include/exclude something from caching
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="executionControl" type="c:ExecutionControlType" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- Execution rules for plugins in cached mode. Defines which plugins should run always
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="ConfigurationType">
- <xs:sequence>
- <xs:element name="enabled" type="xs:boolean"/>
- <xs:element name="hashAlgorithm">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="XX">
- <xs:annotation>
- <xs:documentation>
- 64 bit XX family hashing. Fast, but higher probability of collisions
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="XXMM">
- <xs:annotation>
- <xs:documentation>
- 64 bit XX family hashing, with usage of Memory Mapped Buffer
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="SHA-1"/>
- <xs:enumeration value="SHA-256"/>
- <xs:enumeration value="SHA-384"/>
- <xs:enumeration value="SHA-512"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- <xs:element name="validateXml" type="xs:boolean" default="true">
- <xs:annotation>
- <xs:documentation>
- Validate cache config and builds metadata against xsd.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="projectDiscoveryStrategy" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- Specifies how to identify belonging to a cached project then submodule is being build.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:choice>
- <xs:element name="specificVersion" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- Any project dependency this this version will be considered cache eligible and will
- be processed cache aware
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:choice>
- </xs:complexType>
- </xs:element>
- <xs:element name="remote">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="url" type="xs:string" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- address of remote cache
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="enabled" type="xs:boolean" default="true"/>
- <xs:attribute name="saveToRemote" type="xs:boolean" default="false">
- <xs:annotation>
- <xs:documentation>
- Save output to remote cache. Recommended to enable on CI agents only.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:complexType>
- </xs:element>
- <xs:element name="attachedOutputs" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="dirName" type="xs:string" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Directory name in build output directory to attach to cached artifacts
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="local">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="maxBuildsCached" type="xs:positiveInteger" default="3">
- <xs:annotation>
- <xs:documentation>
- Maximum number of cached build per artifact in local cache. First created cache (the
- oldest) is
- evicted if breached.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="debug" minOccurs="0" maxOccurs="unbounded">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="FileHash">
- <xs:annotation>
- <xs:documentation>
- Causes file hash is saved in build metadata
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="EffectivePom">
- <xs:annotation>
- <xs:documentation>
- Causes effective pom info is saved in build metadata
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="InputType">
- <xs:sequence>
- <xs:element name="global" type="c:PathSetType" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- Global input calculation rules applicable to all projects and plugins in the build
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="plugin" type="c:PluginConfigurationScanType" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Plugin specific input calculation rules
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="PluginConfigurationScanType">
- <xs:complexContent>
- <xs:extension base="c:CoordinatesBaseType">
- <xs:sequence>
- <xs:element name="effectivePom" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- Effective pom calculation rules
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element name="excludeProperty" type="xs:string" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Plugin configuration property should be excluded from effective pom
- calculation
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="dirScan" type="c:DirScanConfigType" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- Specifies plugin level rules of configuration processing in search of referenced source
- files
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="execution" type="c:ExecutionConfigurationScanType" minOccurs="0"
- maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Specifies execution specific configuration processing in search of referenced source
- files
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="ExecutionConfigurationScanType">
- <xs:sequence>
- <xs:element name="execId" maxOccurs="unbounded"/>
- <xs:element name="dirScan" type="c:DirScanConfigType">
- <xs:annotation>
- <xs:documentation>
- Specifies rules of configuration processing in search of referenced source files
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="ignoreParentConfig" type="xs:boolean">
- <xs:annotation>
- <xs:documentation>
- ignore parent config or inherit/merge
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:complexType>
-
- <xs:attributeGroup name="pathScanAttrGroup">
- <xs:annotation>
- <xs:documentation>
- Common attributes for scanning paths
- </xs:documentation>
- </xs:annotation>
- <xs:attribute name="recursive" type="xs:boolean" default="true">
- <xs:annotation>
- <xs:documentation>
- Should walk directory specified in property recursively or not
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="glob" type="xs:string" default="*">
- <xs:annotation>
- <xs:documentation>
- Glob to apply when scanning dir denoted by this property
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:attributeGroup>
-
- <xs:complexType name="TagScanConfigType">
- <xs:simpleContent>
- <xs:extension base="c:TagNameType">
- <xs:attributeGroup ref="c:pathScanAttrGroup"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:complexType name="DirScanConfigType">
- <xs:choice>
- <xs:element name="include" maxOccurs="unbounded" type="c:TagScanConfigType">
- <xs:annotation>
- <xs:documentation>
- Forces cache to treat property value as input and include in calculation. If set, only included
- properties will be takein in calculation (whitelist)
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:sequence>
- <xs:element name="exclude" type="c:TagNameType" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Tag to exclude when scanning plugin configuration for input files (blacklist)
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="tagScanConfig" type="c:TagScanConfigType" minOccurs="0"
- maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Additional processing rules for non-blacklisted tags
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:choice>
-
- <xs:attribute name="ignoreParent" type="xs:boolean" default="false">
- <xs:annotation>
- <xs:documentation>
- Ignore parent settings or inherit and merge
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
-
- <xs:attribute name="mode">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="auto">
- <xs:annotation>
- <xs:documentation>
- Scan directory accordingly to cache implementation
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="skip">
- <xs:annotation>
- <xs:documentation>
- Skip directory
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- </xs:complexType>
-
- <xs:complexType name="OutputType">
- <xs:sequence>
- <xs:element name="exclude" minOccurs="0" maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- Patterns to exclude output artifacts applicable to all projects in the build
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element name="pattern" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="PathSetType">
- <xs:sequence>
- <xs:element name="glob" type="xs:string" minOccurs="0" default="*"/>
- <xs:element name="include" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attributeGroup ref="c:pathScanAttrGroup"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="exclude" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
-
- <!-- <xs:complexType name="ReconciliationType">-->
- <!-- <xs:sequence>-->
- <!-- <xs:element name="plugin" type="c:GoalsReconciliationType" minOccurs="0" maxOccurs="unbounded">-->
- <!-- <xs:annotation>-->
- <!-- <xs:documentation>-->
- <!-- Plugin specific reconciliation rules between cached build and running one-->
- <!-- </xs:documentation>-->
- <!-- </xs:annotation>-->
- <!-- </xs:element>-->
- <!-- </xs:sequence>-->
- <!-- </xs:complexType>-->
-
- <xs:complexType name="GoalReconciliationType">
- <xs:complexContent>
- <xs:extension base="c:GoalIdType">
- <xs:sequence>
- <xs:element name="reconcile" type="c:TrackedPropertyType" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Specify property which should be reconciled against running build
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="log" type="c:PropertyNameType" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Specify property which should be logged to build metadata for exploration
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="nolog" type="c:PropertyNameType" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Specify property which should not be logged
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="logAll" type="xs:boolean" default="true">
- <xs:annotation>
- <xs:documentation>
- Controls if all plugin properties to be logged (true is default). All the properties logged
- with respect to log/nolog children:
- * true: logged all if no blacklists (<nolog/>) and whitelists (<log/>) specified on plugin
- level
- * false: logged only tracked and included by whitelists (<log/>) on plugin level
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="ExecutionControlType">
- <xs:all>
- <xs:element name="runAlways" type="c:ExecutablesType" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- Specify which plugin should run always if present in build regardless of cached status
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="ignoreMissing" type="c:ExecutablesType" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- Specify which executions/plugins/goals do not affect generated artifacts and do not affect build correctness.
- If cached build lacks of ignorable executions only, it still could be reused.
- Typically case is then cached build is produced with 'verify' and you locally you run 'install'.
- Strictly speaking these are different builds but in most of cases you want this difference to be ignored
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="reconcile" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- Specify which plugin should run always if present in build regardless of cached status
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element name="plugin" type="c:GoalReconciliationType" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Reconciliation rules for plugin properties which might be affected by command line
- flags, etc
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="logAllProperties" type="xs:boolean" default="true">
- <xs:annotation>
- <xs:documentation>
- Controls if all plugin properties to be logged (true is default). All the properties
- logged with respect to children:
- * logAll on plugin level overrides global value
- * true: logged all if no blacklists (<nolog/>) and whitelists (<log/>) specified on
- plugin level
- * false: logged only tracked and included by whitelists (<log/>) on plugin level
- <log/>
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:complexType>
- </xs:element>
- </xs:all>
- </xs:complexType>
-
- <xs:complexType name="ExecutablesType">
- <xs:sequence>
- <xs:element name="plugin" type="c:PluginSetType" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Specify which plugin should run always if present in build regardless of cached status
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="execution" type="c:ExecutionIdsListType" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Specify which executions should run always if present in build regardless of cached status
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="goals" type="c:GoalsListType" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Specify which goals should run always if present in build regardless of cached status
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="GoalsListType">
- <xs:complexContent>
- <xs:extension base="c:CoordinatesBaseType">
- <xs:sequence>
- <xs:element name="goal" type="xs:string" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Goals identification
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="GoalIdType">
- <xs:complexContent>
- <xs:extension base="c:CoordinatesBaseType">
- <xs:attribute name="goal" type="xs:string" use="required"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
-
- <xs:complexType name="ExecutionIdsListType">
- <xs:complexContent>
- <xs:extension base="c:CoordinatesBaseType">
- <xs:sequence>
- <xs:element name="execId" type="xs:string" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Executions ids list with plugin identifier
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="PluginSetType">
- <xs:complexContent>
- <xs:extension base="c:CoordinatesBaseType"/>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:complexType name="CoordinatesBaseType">
- <xs:attribute name="groupId" type="xs:string"/>
- <xs:attribute name="artifactId" type="xs:string" use="required"/>
- </xs:complexType>
-
- <xs:complexType name="TagNameType">
- <xs:simpleContent>
- <xs:extension base="c:EmptyString">
- <xs:attribute name="tagName" type="xs:string" use="required"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:complexType name="PropertyNameType">
- <xs:simpleContent>
- <xs:extension base="c:EmptyString">
- <xs:attribute name="propertyName" type="xs:string" use="required"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:simpleType name="EmptyString">
- <xs:restriction base="xs:string">
- <xs:maxLength value="0"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:complexType name="TrackedPropertyType">
- <xs:simpleContent>
- <xs:extension base="c:PropertyNameType">
- <xs:attribute name="skipValue" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- Specify which value denotes skipped execution in plugin config.
- If active build skips execution (property set to skipValue) cache will allow such
- discrepancy.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="defaultValue" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- Manual value for reconciliation. Required to reconcile runtime only properties
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
-</xs:schema>
diff --git a/maven-core/src/main/resources/cache-domain.xsd b/maven-core/src/main/resources/cache-domain.xsd
deleted file mode 100644
index c233ed4..0000000
--- a/maven-core/src/main/resources/cache-domain.xsd
+++ /dev/null
@@ -1,187 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<!--
-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.
--->
-
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:d="org:apache:maven:cache:domain"
- elementFormDefault="qualified"
- targetNamespace="org:apache:maven:cache:domain">
-
- <xs:element name="build" type="d:BuildInfoType"/>
- <xs:element name="report" type="d:CacheReportType"/>
- <xs:element name="diff" type="d:BuildDiffType"/>
-
- <xs:complexType name="BuildInfoType">
- <xs:all>
- <xs:element name="cacheImplementationVersion" type="xs:string"/>
- <xs:element name="final" type="xs:boolean" minOccurs="0"/>
- <xs:element name="hashFunction" type="xs:string"/>
- <xs:element name="buildTime" type="xs:dateTime" minOccurs="0"/>
- <xs:element name="buildServer" type="xs:string" minOccurs="0"/>
- <xs:element name="scm" minOccurs="0">
- <xs:complexType>
- <xs:all>
- <xs:element name="sourceBranch" type="xs:string" minOccurs="0"/>
- <xs:element name="revision" type="xs:string" minOccurs="0"/>
- </xs:all>
- </xs:complexType>
- </xs:element>
- <xs:element name="goals">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="goal" type="xs:string" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="artifact" type="d:ArtifactType"/>
- <xs:element name="attachedArtifacts">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="artifact" type="d:ArtifactType" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="generatedSources" minOccurs="0">
- <xs:complexType>
- <xs:all>
- <xs:element name="relativePath">
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="artifactFileName" type="xs:string" use="required"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:all>
- </xs:complexType>
- </xs:element>
- <xs:element name="executions">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="execution" type="d:CompletedExecutionType" minOccurs="0"
- maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="projectsInputInfo" type="d:ProjectsInputInfoType" minOccurs="0"/>
- </xs:all>
- </xs:complexType>
-
- <xs:complexType name="ArtifactType">
- <xs:sequence>
- <xs:element name="groupId" type="xs:string"/>
- <xs:element name="artifactId" type="xs:string"/>
- <xs:element name="version" type="xs:string"/>
- <xs:element name="classifier" type="xs:string" minOccurs="0"/>
- <xs:element name="type" type="xs:string"/>
- <xs:element name="scope" type="xs:string" minOccurs="0"/>
- <xs:element name="fileName" type="xs:string" minOccurs="0"/>
- <xs:element name="fileHash" type="xs:string" minOccurs="0"/>
- <xs:element name="fileSize" type="xs:nonNegativeInteger" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="CompletedExecutionType">
- <xs:sequence>
- <xs:element name="executionKey" type="xs:string"/>
- <xs:element name="mojoClassName" type="xs:string" minOccurs="0"/>
- <xs:element name="configuration" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="property" type="d:PropertyValueType" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="PropertyValueType">
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="name" type="xs:string"/>
- <xs:attribute name="tracked" type="xs:boolean"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:complexType name="ProjectsInputInfoType">
- <xs:sequence>
- <xs:element name="checksum" type="xs:string"/>
- <xs:element name="item" type="d:DigestItemType" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="DigestItemType">
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="type" use="required" type="xs:string"/>
- <xs:attribute name="hash" use="required" type="xs:string"/>
- <xs:attribute name="fileChecksum" type="xs:string"/>
- <xs:attribute name="content" type="xs:string"/>
- <xs:attribute name="isText" type="xs:string"/>
- <xs:attribute name="charset" type="xs:string"/>
- <xs:attribute name="eol" type="xs:string"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:complexType name="CacheReportType">
- <xs:sequence>
- <xs:element name="project" type="d:ProjectReportType" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="ProjectReportType">
- <!-- <xs:sequence>-->
- <!-- <xs:element name="checksum" type="d:ChecksumReportType"/>-->
- <!-- <xs:element name="parameters" type="d:PluginsReportType"/>-->
- <!-- </xs:sequence>-->
- <xs:attribute name="groupId" use="required" type="xs:string"/>
- <xs:attribute name="artifactId" use="required" type="xs:string"/>
- <xs:attribute name="checksum" use="required" type="xs:string"/>
- <xs:attribute name="checksumMatched" type="xs:boolean" use="required"/>
- <xs:attribute name="lifecycleMatched" type="xs:boolean"/>
- <xs:attribute name="pluginsMatched" type="xs:boolean"/>
- <xs:attribute name="source" type="xs:string" use="required"/>
- <xs:attribute name="sharedToRemote" type="xs:boolean" use="required"/>
- <xs:attribute name="url" type="xs:anyURI"/>
- </xs:complexType>
-
- <xs:complexType name="BuildDiffType">
- <xs:sequence>
- <xs:element name="mismatch" type="d:MismatchType" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="MismatchType">
- <xs:sequence minOccurs="0">
- <xs:element name="detail" type="d:MismatchDetailType" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="item" use="required" type="xs:string"/>
- <xs:attribute name="current" type="xs:string"/>
- <xs:attribute name="baseline" type="xs:string"/>
- <xs:attribute name="reason" type="xs:string"/>
- <xs:attribute name="resolution" type="xs:string"/>
- <xs:attribute name="context" type="xs:string"/>
- </xs:complexType>
-
- <xs:complexType name="MismatchDetailType"/>
-</xs:schema>
diff --git a/maven-core/src/test/java/org/apache/maven/caching/xml/CacheConfigTest.java b/maven-core/src/test/java/org/apache/maven/caching/xml/CacheConfigTest.java
index b18752f..c589181 100644
--- a/maven-core/src/test/java/org/apache/maven/caching/xml/CacheConfigTest.java
+++ b/maven-core/src/test/java/org/apache/maven/caching/xml/CacheConfigTest.java
@@ -19,8 +19,10 @@ package org.apache.maven.caching.xml;
* under the License.
*/
+import org.apache.maven.caching.domain.CacheType;
import org.junit.Test;
+import java.io.InputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -28,8 +30,8 @@ public class CacheConfigTest {
@Test
public void testMU() {
-// final Path path = Paths.get("W:\\dev\\abfx\\maven-cache-config.xml");
-// final CacheConfig cacheConfig = CacheConfig.fromFile(path.toFile());
-// System.out.println(cacheConfig.toString());
+ InputStream is = getClass().getResourceAsStream( "cache-config-instance.xml" );
+ final CacheType cacheConfig = new XmlService().fromInputStream( CacheType.class, is );
+ System.out.println(cacheConfig.toString());
}
}
\ No newline at end of file
diff --git a/maven-core/src/test/resources/org/apache/maven/caching/xml/cache-config-instance.xml b/maven-core/src/test/resources/org/apache/maven/caching/xml/cache-config-instance.xml
new file mode 100644
index 0000000..92e3ce7
--- /dev/null
+++ b/maven-core/src/test/resources/org/apache/maven/caching/xml/cache-config-instance.xml
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!--
+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.
+-->
+
+<cache xmlns="org:apache:maven:cache:config"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="org:apache:maven:cache:config ../../../../../../../../target/generated-sources/modello/cache-config-1.0.0.xsd">
+
+ <configuration>
+ <enabled>true</enabled>
+ <hashAlgorithm>SHA-256</hashAlgorithm>
+ <validateXml>true</validateXml>
+ <remote>
+ <url>http://host:port</url>
+ </remote>
+ <local>
+ <maxBuildsCached>3</maxBuildsCached>
+ </local>
+ </configuration>
+
+ <input>
+ <global>
+ <glob>
+ {*.java,*.groovy,*.yaml,*.svcd,*.proto,*assembly.xml,assembly*.xml,*logback.xml,*.vm,*.ini,*.jks,*.properties,*.sh,*.bat}
+ </glob>
+ <includes>
+ <include>src/</include>
+ </includes>
+ <excludes>
+ <exclude>pom.xml</exclude>
+ </excludes>
+ </global>
+ <plugins>
+ <plugin artifactId="bb-sdk-codegen">
+ <effectivePom>
+ <excludeProperties>
+ <excludeProperty>111</excludeProperty>
+ </excludeProperties>
+ </effectivePom>
+ <dirScan mode="auto">
+ <excludes>
+ <exclude tagName="outputDirectory"/>
+ <exclude tagName="directory"/>
+ </excludes>
+ <tagScanConfigs>
+ <tagScanConfig tagName="someProperty" glob="*.java" recursive="false"/>
+ </tagScanConfigs>
+ </dirScan>
+ <executions>
+ <execution>
+ <execIds>
+ <execId>1</execId>
+ <execId>2</execId>
+ </execIds>
+ <dirScan mode="auto">
+ <includes>
+ <include tagName="protolocation" recursive="false" glob="*.proto"/>
+ </includes>
+ </dirScan>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </input>
+ <output>
+ <exclude>
+ <patterns>
+ <pattern>.*-processes.*\.zip</pattern>
+ </patterns>
+ </exclude>
+ </output>
+ <executionControl>
+ <runAlways>
+ <plugins>
+ <plugin artifactId="maven-failsafe-plugin"/>
+ </plugins>
+ <executions>
+ <execution artifactId="maven-deploy-plugin">
+ <execIds>
+ <execId>aaa</execId>
+ </execIds>
+ </execution>
+ </executions>
+ <goalsLists>
+ <goalsList artifactId="maven-install-plugin">
+ <goals>
+ <goal>install</goal>
+ </goals>
+ </goalsList>
+ <goalsList artifactId="maven-deploy-plugin">
+ <goals>
+ <goal>deploy</goal>
+ </goals>
+ </goalsList>
+ <goalsList artifactId="bb-sdk-codegen">
+ <goals>
+ <goal>deploy-local</goal>
+ </goals>
+ </goalsList>
+ </goalsLists>
+ </runAlways>
+ <ignoreMissing>
+ <plugins>
+ <plugin artifactId="maven-deploy-plugin"/>
+ <plugin artifactId="maven-install-plugin"/>
+ </plugins>
+ </ignoreMissing>
+ <reconcile logAllProperties="true">
+ <plugins>
+ <plugin artifactId="maven-compiler-plugin" goal="compile">
+ <reconciles>
+ <reconcile propertyName="source"/>
+ <reconcile propertyName="target"/>
+ <reconcile propertyName="debug"/>
+ <reconcile propertyName="debuglevel"/>
+ </reconciles>
+ <!-- whitelist of logged properties-->
+ <logs>
+ <log propertyName="includes"/>
+ <log propertyName="excludes"/>
+ <log propertyName="argLine"/>
+ </logs>
+ </plugin>
+ <plugin artifactId="duplicate-finder-maven-plugin" goal="check">
+ <reconciles>
+ <reconcile propertyName="skip" skipValue="true"/>
+ <reconcile propertyName="quiet" skipValue="true"/>
+ </reconciles>
+ </plugin>
+ <plugin artifactId="maven-enforcer-plugin" goal="enforce">
+ <reconciles>
+ <reconcile propertyName="skip" skipValue="true"/>
+ </reconciles>
+ <!-- blacklisted from logging properties-->
+ <nologs>
+ <nolog propertyName="redundantProperty"/>
+ <nolog propertyName="redundantProperty2"/>
+ </nologs>
+ </plugin>
+ </plugins>
+ </reconcile>
+ </executionControl>
+</cache>
diff --git a/maven-core/src/main/resources/cache-domain-instance.xml b/maven-core/src/test/resources/org/apache/maven/caching/xml/cache-domain-instance.xml
similarity index 100%
rename from maven-core/src/main/resources/cache-domain-instance.xml
rename to maven-core/src/test/resources/org/apache/maven/caching/xml/cache-domain-instance.xml