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/08 18:58:52 UTC
[maven] 02/05: [MNG-7324] Complete modello switch
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 fe5e0ffe34707703018514a23d72bd0ba32bb92d
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Thu Nov 4 20:57:07 2021 +0100
[MNG-7324] Complete modello switch
---
maven-core/pom.xml | 7 +
.../apache/maven/caching/ArtifactsRepository.java | 2 +-
.../org/apache/maven/caching/CacheContext.java | 2 +-
.../apache/maven/caching/CacheControllerImpl.java | 29 +-
.../java/org/apache/maven/caching/CacheDiff.java | 28 +-
.../java/org/apache/maven/caching/CacheResult.java | 2 +-
.../maven/caching/DefaultPluginScanConfig.java | 2 +-
.../apache/maven/caching/HttpRepositoryImpl.java | 10 +-
.../maven/caching/LocalArtifactsRepository.java | 2 +-
.../apache/maven/caching/LocalRepositoryImpl.java | 11 +-
.../apache/maven/caching/MojoExecutionManager.java | 6 +-
.../org/apache/maven/caching/PluginScanConfig.java | 2 +-
.../apache/maven/caching/PluginScanConfigImpl.java | 8 +-
.../org/apache/maven/caching/ProjectUtils.java | 6 +-
.../maven/caching/RemoteArtifactsRepository.java | 2 +-
.../apache/maven/caching/checksum/DigestUtils.java | 2 +-
.../apache/maven/caching/checksum/KeyUtils.java | 2 +-
.../maven/caching/checksum/MavenProjectInput.java | 6 +-
.../org/apache/maven/caching/xml/BuildInfo.java | 72 +-
.../org/apache/maven/caching/xml/CacheConfig.java | 8 +-
.../apache/maven/caching/xml/CacheConfigImpl.java | 68 +-
.../org/apache/maven/caching/xml/DtoUtils.java | 69 +-
.../org/apache/maven/caching/xml/XmlService.java | 149 +--
maven-core/src/main/mdo/cache-config.mdo | 1390 ++++++++++++++++++++
maven-core/src/main/mdo/cache-diff.mdo | 109 ++
maven-core/src/main/mdo/cache-domain.mdo | 365 +++--
maven-core/src/main/mdo/cache-report.mdo | 108 ++
.../org/apache/maven/caching/BuildInfoTest.java | 39 +-
28 files changed, 2080 insertions(+), 426 deletions(-)
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index b1e830e..bdd5543 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -235,11 +235,16 @@ under the License.
<goals>
<goal>java</goal>
<goal>xpp3-reader</goal>
+ <goal>xpp3-writer</goal>
+ <goal>xsd</goal>
</goals>
<configuration>
<version>1.0.0</version>
<models>
+ <model>src/main/mdo/cache-config.mdo</model>
<model>src/main/mdo/cache-domain.mdo</model>
+ <model>src/main/mdo/cache-diff.mdo</model>
+ <model>src/main/mdo/cache-report.mdo</model>
</models>
</configuration>
</execution>
@@ -275,6 +280,7 @@ under the License.
</execution>
</executions>
</plugin>
+ <!--
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
@@ -295,6 +301,7 @@ under the License.
</sources>
</configuration>
</plugin>
+ -->
</plugins>
</build>
</project>
diff --git a/maven-core/src/main/java/org/apache/maven/caching/ArtifactsRepository.java b/maven-core/src/main/java/org/apache/maven/caching/ArtifactsRepository.java
index 6531549..968bae2 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/ArtifactsRepository.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/ArtifactsRepository.java
@@ -20,7 +20,7 @@ package org.apache.maven.caching;
*/
import org.apache.maven.artifact.Artifact;
-import org.apache.maven.caching.jaxb.CacheReportType;
+import org.apache.maven.caching.domain.CacheReportType;
import org.apache.maven.caching.xml.BuildInfo;
import org.apache.maven.execution.MavenSession;
diff --git a/maven-core/src/main/java/org/apache/maven/caching/CacheContext.java b/maven-core/src/main/java/org/apache/maven/caching/CacheContext.java
index 569286d..49b552e 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/CacheContext.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/CacheContext.java
@@ -19,7 +19,7 @@ package org.apache.maven.caching;
* under the License.
*/
-import org.apache.maven.caching.jaxb.ProjectsInputInfoType;
+import org.apache.maven.caching.domain.ProjectsInputInfoType;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.project.MavenProject;
diff --git a/maven-core/src/main/java/org/apache/maven/caching/CacheControllerImpl.java b/maven-core/src/main/java/org/apache/maven/caching/CacheControllerImpl.java
index ad9d490..05e56a5 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/CacheControllerImpl.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/CacheControllerImpl.java
@@ -31,18 +31,18 @@ import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
import org.apache.maven.caching.checksum.KeyUtils;
import org.apache.maven.caching.checksum.MavenProjectInput;
+import org.apache.maven.caching.domain.Scm;
import org.apache.maven.caching.hash.HashAlgorithm;
import org.apache.maven.caching.hash.HashFactory;
-import org.apache.maven.caching.jaxb.ArtifactType;
-import org.apache.maven.caching.jaxb.BuildDiffType;
-import org.apache.maven.caching.jaxb.BuildInfoType;
-import org.apache.maven.caching.jaxb.CacheReportType;
-import org.apache.maven.caching.jaxb.CompletedExecutionType;
-import org.apache.maven.caching.jaxb.DigestItemType;
-import org.apache.maven.caching.jaxb.ProjectReportType;
-import org.apache.maven.caching.jaxb.ProjectsInputInfoType;
-import org.apache.maven.caching.jaxb.PropertyNameType;
-import org.apache.maven.caching.jaxb.TrackedPropertyType;
+import org.apache.maven.caching.domain.ArtifactType;
+import org.apache.maven.caching.domain.BuildDiffType;
+import org.apache.maven.caching.domain.CacheReportType;
+import org.apache.maven.caching.domain.CompletedExecutionType;
+import org.apache.maven.caching.domain.DigestItemType;
+import org.apache.maven.caching.domain.ProjectReportType;
+import org.apache.maven.caching.domain.ProjectsInputInfoType;
+import org.apache.maven.caching.domain.PropertyNameType;
+import org.apache.maven.caching.domain.TrackedPropertyType;
import org.apache.maven.caching.xml.BuildInfo;
import org.apache.maven.caching.xml.CacheConfig;
import org.apache.maven.caching.xml.CacheSource;
@@ -67,7 +67,6 @@ import javax.annotation.Nonnull;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
@@ -143,7 +142,7 @@ public class CacheControllerImpl implements CacheController
private final ConcurrentMap<String, CacheResult> cacheResults = new ConcurrentHashMap<>();
- private volatile BuildInfoType.Scm scm;
+ private volatile Scm scm;
@Override
@Nonnull
@@ -434,7 +433,7 @@ public class CacheControllerImpl implements CacheController
final BuildInfo buildInfo = new BuildInfo( session.getGoals(), projectArtifactDto, attachedArtifactDtos,
context.getInputInfo(), completedExecution, hashFactory.getAlgorithm() );
populateGitInfo( buildInfo, session );
- buildInfo.getDto().setFinal( cacheConfig.isSaveFinal() );
+ buildInfo.getDto().set_final( cacheConfig.isSaveFinal() );
cacheResults.put( getVersionlessProjectKey( project ), rebuilded( cacheResult, buildInfo ) );
// if package phase presence means new artifacts were packaged
@@ -554,7 +553,7 @@ public class CacheControllerImpl implements CacheController
{
final Path file = projectArtifact.getFile().toPath();
dto.setFileHash( algorithm.hash( file ) );
- dto.setFileSize( BigInteger.valueOf( Files.size( file ) ) );
+ dto.setFileSize( Files.size( file ) );
}
return dto;
}
@@ -798,7 +797,7 @@ public class CacheControllerImpl implements CacheController
}
catch ( IOException e )
{
- scm = new BuildInfoType.Scm();
+ scm = new Scm();
logger.error( "Cannot populate git info", e );
}
}
diff --git a/maven-core/src/main/java/org/apache/maven/caching/CacheDiff.java b/maven-core/src/main/java/org/apache/maven/caching/CacheDiff.java
index 9e066a5..5808e18 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/CacheDiff.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/CacheDiff.java
@@ -22,13 +22,13 @@ package org.apache.maven.caching;
import com.google.common.base.Optional;
import com.google.common.collect.Sets;
import org.apache.commons.lang3.StringUtils;
-import org.apache.maven.caching.jaxb.BuildDiffType;
-import org.apache.maven.caching.jaxb.BuildInfoType;
-import org.apache.maven.caching.jaxb.CompletedExecutionType;
-import org.apache.maven.caching.jaxb.DigestItemType;
-import org.apache.maven.caching.jaxb.MismatchType;
-import org.apache.maven.caching.jaxb.ProjectsInputInfoType;
-import org.apache.maven.caching.jaxb.PropertyValueType;
+import org.apache.maven.caching.domain.BuildDiffType;
+import org.apache.maven.caching.domain.BuildInfoType;
+import org.apache.maven.caching.domain.CompletedExecutionType;
+import org.apache.maven.caching.domain.DigestItemType;
+import org.apache.maven.caching.domain.MismatchType;
+import org.apache.maven.caching.domain.ProjectsInputInfoType;
+import org.apache.maven.caching.domain.PropertyValueType;
import org.apache.maven.caching.xml.CacheConfig;
import java.util.ArrayList;
@@ -232,23 +232,23 @@ public class CacheDiff
}
- private void compareExecutions( BuildInfoType.Executions current, BuildInfoType.Executions baseline )
+ private void compareExecutions( List<CompletedExecutionType> current, List<CompletedExecutionType> baseline )
{
Map<String, CompletedExecutionType> baselineExecutionsByKey = new HashMap<>();
- for ( CompletedExecutionType completedExecutionType : baseline.getExecution() )
+ for ( CompletedExecutionType completedExecutionType : baseline )
{
baselineExecutionsByKey.put( completedExecutionType.getExecutionKey(), completedExecutionType );
}
Map<String, CompletedExecutionType> currentExecutionsByKey = new HashMap<>();
- for ( CompletedExecutionType e1 : current.getExecution() )
+ for ( CompletedExecutionType e1 : current )
{
currentExecutionsByKey.put( e1.getExecutionKey(), e1 );
}
// such situation normally means different poms and mismatch in effective poms,
// but in any case it is helpful to report
- for ( CompletedExecutionType baselineExecution : baseline.getExecution() )
+ for ( CompletedExecutionType baselineExecution : baseline )
{
if ( !currentExecutionsByKey.containsKey( baselineExecution.getExecutionKey() ) )
{
@@ -261,7 +261,7 @@ public class CacheDiff
}
}
- for ( CompletedExecutionType currentExecution : current.getExecution() )
+ for ( CompletedExecutionType currentExecution : current )
{
if ( !baselineExecutionsByKey.containsKey( currentExecution.getExecutionKey() ) )
{
@@ -285,7 +285,7 @@ public class CacheDiff
{
// TODO add support for skip values
final List<PropertyValueType> trackedProperties = new ArrayList<>();
- for ( PropertyValueType propertyValueType : current.getConfiguration().getProperty() )
+ for ( PropertyValueType propertyValueType : current.getConfiguration() )
{
if ( propertyValueType.isTracked() )
{
@@ -298,7 +298,7 @@ public class CacheDiff
}
final Map<String, PropertyValueType> baselinePropertiesByName = new HashMap<>();
- for ( PropertyValueType propertyValueType : baseline.getConfiguration().getProperty() )
+ for ( PropertyValueType propertyValueType : baseline.getConfiguration() )
{
baselinePropertiesByName.put( propertyValueType.getName(), propertyValueType );
}
diff --git a/maven-core/src/main/java/org/apache/maven/caching/CacheResult.java b/maven-core/src/main/java/org/apache/maven/caching/CacheResult.java
index 8d88676..84038a3 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/CacheResult.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/CacheResult.java
@@ -117,6 +117,6 @@ public class CacheResult
public boolean isFinal()
{
- return buildInfo != null && buildInfo.getDto().isFinal();
+ return buildInfo != null && buildInfo.getDto().is_final();
}
}
diff --git a/maven-core/src/main/java/org/apache/maven/caching/DefaultPluginScanConfig.java b/maven-core/src/main/java/org/apache/maven/caching/DefaultPluginScanConfig.java
index 408d097..8229435 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/DefaultPluginScanConfig.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/DefaultPluginScanConfig.java
@@ -19,7 +19,7 @@ package org.apache.maven.caching;
* under the License.
*/
-import org.apache.maven.caching.jaxb.DirScanConfigType;
+import org.apache.maven.caching.domain.DirScanConfigType;
import javax.annotation.Nonnull;
diff --git a/maven-core/src/main/java/org/apache/maven/caching/HttpRepositoryImpl.java b/maven-core/src/main/java/org/apache/maven/caching/HttpRepositoryImpl.java
index fbbe509..6747532 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/HttpRepositoryImpl.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/HttpRepositoryImpl.java
@@ -33,10 +33,10 @@ import org.apache.http.entity.InputStreamEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.caching.checksum.MavenProjectInput;
-import org.apache.maven.caching.jaxb.ArtifactType;
-import org.apache.maven.caching.jaxb.BuildInfoType;
-import org.apache.maven.caching.jaxb.CacheReportType;
-import org.apache.maven.caching.jaxb.ProjectReportType;
+import org.apache.maven.caching.domain.ArtifactType;
+import org.apache.maven.caching.domain.BuildInfoType;
+import org.apache.maven.caching.domain.CacheReportType;
+import org.apache.maven.caching.domain.ProjectReportType;
import org.apache.maven.caching.xml.BuildInfo;
import org.apache.maven.caching.xml.CacheConfig;
import org.apache.maven.caching.xml.CacheSource;
@@ -268,7 +268,7 @@ public class HttpRepositoryImpl implements RemoteArtifactsRepository
{
String url;
final ProjectReportType projectReport = cachedProjectHolder.get();
- if ( projectReport.isSetUrl() )
+ if ( projectReport.getUrl() != null )
{
url = cachedProjectHolder.get().getUrl();
logInfo( "Retrieving baseline buildinfo: " + projectReport.getUrl(), project.getArtifactId() );
diff --git a/maven-core/src/main/java/org/apache/maven/caching/LocalArtifactsRepository.java b/maven-core/src/main/java/org/apache/maven/caching/LocalArtifactsRepository.java
index c5916b2..280c2be 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/LocalArtifactsRepository.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/LocalArtifactsRepository.java
@@ -20,7 +20,7 @@ package org.apache.maven.caching;
*/
import com.google.common.base.Optional;
-import org.apache.maven.caching.jaxb.ArtifactType;
+import org.apache.maven.caching.domain.ArtifactType;
import org.apache.maven.caching.xml.BuildInfo;
import org.apache.maven.caching.xml.CacheSource;
import org.apache.maven.execution.MavenSession;
diff --git a/maven-core/src/main/java/org/apache/maven/caching/LocalRepositoryImpl.java b/maven-core/src/main/java/org/apache/maven/caching/LocalRepositoryImpl.java
index ec75b47..78d1d1a 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/LocalRepositoryImpl.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/LocalRepositoryImpl.java
@@ -31,9 +31,10 @@ import com.google.common.collect.Ordering;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.maven.artifact.Artifact;
-import org.apache.maven.caching.jaxb.ArtifactType;
-import org.apache.maven.caching.jaxb.BuildInfoType;
-import org.apache.maven.caching.jaxb.CacheReportType;
+import org.apache.maven.caching.domain.ArtifactType;
+import org.apache.maven.caching.domain.BuildInfoType;
+import org.apache.maven.caching.domain.CacheReportType;
+import org.apache.maven.caching.domain.Scm;
import org.apache.maven.caching.xml.BuildInfo;
import org.apache.maven.caching.xml.CacheConfig;
import org.apache.maven.caching.xml.CacheSource;
@@ -350,11 +351,11 @@ public class LocalRepositoryImpl implements LocalArtifactsRepository
return Optional.of( orderedFiles.get( 0 ).getLeft() );
}
- private String getScmRef( BuildInfoType.Scm scm )
+ private String getScmRef( Scm scm )
{
if ( scm != null )
{
- return scm.isSetSourceBranch() ? scm.getSourceBranch() : scm.getRevision();
+ return scm.getSourceBranch() != null ? scm.getSourceBranch() : scm.getRevision();
}
else
{
diff --git a/maven-core/src/main/java/org/apache/maven/caching/MojoExecutionManager.java b/maven-core/src/main/java/org/apache/maven/caching/MojoExecutionManager.java
index 9c07e58..a6e1936 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/MojoExecutionManager.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/MojoExecutionManager.java
@@ -20,8 +20,8 @@ package org.apache.maven.caching;
*/
import org.apache.commons.lang3.StringUtils;
-import org.apache.maven.caching.jaxb.CompletedExecutionType;
-import org.apache.maven.caching.jaxb.TrackedPropertyType;
+import org.apache.maven.caching.domain.CompletedExecutionType;
+import org.apache.maven.caching.domain.TrackedPropertyType;
import org.apache.maven.caching.xml.BuildInfo;
import org.apache.maven.caching.xml.CacheConfig;
import org.apache.maven.caching.xml.DtoUtils;
@@ -124,7 +124,7 @@ public class MojoExecutionManager implements MojoCheker
final String propertyName = trackedProperty.getPropertyName();
String expectedValue = DtoUtils.findPropertyValue( propertyName, completedExecution );
- if ( expectedValue == null && trackedProperty.isSetDefaultValue() )
+ if ( expectedValue == null && trackedProperty.getDefaultValue() != null )
{
expectedValue = trackedProperty.getDefaultValue();
}
diff --git a/maven-core/src/main/java/org/apache/maven/caching/PluginScanConfig.java b/maven-core/src/main/java/org/apache/maven/caching/PluginScanConfig.java
index 93bcccb..a3af7b6 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/PluginScanConfig.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/PluginScanConfig.java
@@ -19,7 +19,7 @@ package org.apache.maven.caching;
* under the License.
*/
-import org.apache.maven.caching.jaxb.DirScanConfigType;
+import org.apache.maven.caching.domain.DirScanConfigType;
import javax.annotation.Nonnull;
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 8779190..e95342c 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
@@ -20,9 +20,9 @@ package org.apache.maven.caching;
*/
import org.apache.commons.lang3.StringUtils;
-import org.apache.maven.caching.jaxb.DirScanConfigType;
-import org.apache.maven.caching.jaxb.TagNameType;
-import org.apache.maven.caching.jaxb.TagScanConfigType;
+import org.apache.maven.caching.domain.DirScanConfigType;
+import org.apache.maven.caching.domain.TagNameType;
+import org.apache.maven.caching.domain.TagScanConfigType;
import javax.annotation.Nonnull;
import java.util.List;
@@ -95,7 +95,7 @@ public class PluginScanConfigImpl implements PluginScanConfig
}
DirScanConfigType merged = new DirScanConfigType();
- if ( override.isSetMode() )
+ if ( override.getMode() != null )
{
merged.setMode( override.getMode() );
}
diff --git a/maven-core/src/main/java/org/apache/maven/caching/ProjectUtils.java b/maven-core/src/main/java/org/apache/maven/caching/ProjectUtils.java
index 1765568..dbf9251 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/ProjectUtils.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/ProjectUtils.java
@@ -25,7 +25,7 @@ import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.handler.ArtifactHandler;
-import org.apache.maven.caching.jaxb.BuildInfoType;
+import org.apache.maven.caching.domain.Scm;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.lifecycle.internal.ProjectIndex;
import org.apache.maven.lifecycle.internal.builder.BuilderCommon;
@@ -155,9 +155,9 @@ public class ProjectUtils
return System.getProperty( "maven.multiModuleProjectDirectory", session.getExecutionRootDirectory() );
}
- public static BuildInfoType.Scm readGitInfo( MavenSession session ) throws IOException
+ public static Scm readGitInfo( MavenSession session ) throws IOException
{
- final BuildInfoType.Scm scmCandidate = new BuildInfoType.Scm();
+ final Scm scmCandidate = new Scm();
final Path gitDir = Paths.get( getMultimoduleRoot( session ), ".git" );
if ( Files.isDirectory( gitDir ) )
{
diff --git a/maven-core/src/main/java/org/apache/maven/caching/RemoteArtifactsRepository.java b/maven-core/src/main/java/org/apache/maven/caching/RemoteArtifactsRepository.java
index 7c118c4..826faf3 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/RemoteArtifactsRepository.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/RemoteArtifactsRepository.java
@@ -20,7 +20,7 @@ package org.apache.maven.caching;
*/
import com.google.common.base.Optional;
-import org.apache.maven.caching.jaxb.ArtifactType;
+import org.apache.maven.caching.domain.ArtifactType;
import org.apache.maven.caching.xml.BuildInfo;
import org.apache.maven.project.MavenProject;
diff --git a/maven-core/src/main/java/org/apache/maven/caching/checksum/DigestUtils.java b/maven-core/src/main/java/org/apache/maven/caching/checksum/DigestUtils.java
index e837da1..0a156e2 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/checksum/DigestUtils.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/checksum/DigestUtils.java
@@ -22,7 +22,7 @@ package org.apache.maven.caching.checksum;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.caching.hash.HashChecksum;
-import org.apache.maven.caching.jaxb.DigestItemType;
+import org.apache.maven.caching.domain.DigestItemType;
import org.mozilla.universalchardet.UniversalDetector;
import java.io.IOException;
diff --git a/maven-core/src/main/java/org/apache/maven/caching/checksum/KeyUtils.java b/maven-core/src/main/java/org/apache/maven/caching/checksum/KeyUtils.java
index 04d9207..90da23e 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/checksum/KeyUtils.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/checksum/KeyUtils.java
@@ -21,7 +21,7 @@ package org.apache.maven.caching.checksum;
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.artifact.Artifact;
-import org.apache.maven.caching.jaxb.ArtifactType;
+import org.apache.maven.caching.domain.ArtifactType;
import org.apache.maven.model.Dependency;
import org.apache.maven.project.MavenProject;
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 8e5873c..ca78ada 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
@@ -36,8 +36,9 @@ import org.apache.maven.caching.ScanConfigProperties;
import org.apache.maven.caching.hash.HashAlgorithm;
import org.apache.maven.caching.hash.HashChecksum;
import org.apache.maven.caching.hash.HashFactory;
-import org.apache.maven.caching.jaxb.DigestItemType;
-import org.apache.maven.caching.jaxb.ProjectsInputInfoType;
+import org.apache.maven.caching.domain.DigestItemType;
+import org.apache.maven.caching.domain.Include;
+import org.apache.maven.caching.domain.ProjectsInputInfoType;
import org.apache.maven.caching.xml.BuildInfo;
import org.apache.maven.caching.xml.CacheConfig;
import org.apache.maven.caching.xml.DtoUtils;
@@ -94,7 +95,6 @@ import static org.apache.commons.lang3.StringUtils.startsWithAny;
import static org.apache.commons.lang3.StringUtils.stripToEmpty;
import static org.apache.maven.caching.ProjectUtils.isBuilding;
import static org.apache.maven.caching.ProjectUtils.isSnapshot;
-import static org.apache.maven.caching.jaxb.PathSetType.Include;
/**
* MavenProjectInput
diff --git a/maven-core/src/main/java/org/apache/maven/caching/xml/BuildInfo.java b/maven-core/src/main/java/org/apache/maven/caching/xml/BuildInfo.java
index 0b61bfd..452811e 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/xml/BuildInfo.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/xml/BuildInfo.java
@@ -24,24 +24,22 @@ import org.apache.maven.artifact.Artifact;
import org.apache.maven.caching.ProjectUtils;
import org.apache.maven.caching.checksum.MavenProjectInput;
import org.apache.maven.caching.hash.HashAlgorithm;
-import org.apache.maven.caching.jaxb.ArtifactType;
-import org.apache.maven.caching.jaxb.BuildInfoType;
-import org.apache.maven.caching.jaxb.CompletedExecutionType;
-import org.apache.maven.caching.jaxb.DigestItemType;
-import org.apache.maven.caching.jaxb.ProjectsInputInfoType;
+import org.apache.maven.caching.domain.ArtifactType;
+import org.apache.maven.caching.domain.BuildInfoType;
+import org.apache.maven.caching.domain.CompletedExecutionType;
+import org.apache.maven.caching.domain.DigestItemType;
+import org.apache.maven.caching.domain.ProjectsInputInfoType;
import org.apache.maven.model.Dependency;
import org.apache.maven.plugin.MojoExecution;
import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.util.StringUtils;
-import javax.xml.datatype.DatatypeConfigurationException;
-import javax.xml.datatype.DatatypeFactory;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.GregorianCalendar;
+import java.util.Date;
import java.util.List;
import java.util.Objects;
@@ -66,13 +64,7 @@ public class BuildInfo
{
this.dto = new BuildInfoType();
this.dto.setCacheImplementationVersion( MavenProjectInput.CACHE_IMPLMENTATION_VERSION );
- try
- {
- this.dto.setBuildTime( DatatypeFactory.newInstance().newXMLGregorianCalendar( new GregorianCalendar() ) );
- }
- catch ( DatatypeConfigurationException ignore )
- {
- }
+ this.dto.setBuildTime( new Date() );
try
{
this.dto.setBuildServer( InetAddress.getLocalHost().getCanonicalHostName() );
@@ -83,10 +75,9 @@ public class BuildInfo
}
this.dto.setHashFunction( hashAlgorithm );
this.dto.setArtifact( artifact );
- this.dto.setGoals( createGoals( goals ) );
- this.dto.setAttachedArtifacts( new BuildInfoType.AttachedArtifacts() );
- this.dto.getAttachedArtifacts().getArtifact().addAll( attachedArtifacts );
- this.dto.setExecutions( createExecutions( completedExecutions ) );
+ this.dto.setGoals( goals );
+ this.dto.setAttachedArtifacts( attachedArtifacts );
+ this.dto.setExecutions( completedExecutions );
this.dto.setProjectsInputInfo( projectsInputInfo );
this.source = CacheSource.BUILD;
}
@@ -96,30 +87,16 @@ public class BuildInfo
return source;
}
- private BuildInfoType.Executions createExecutions( List<CompletedExecutionType> completedExecutions )
- {
- BuildInfoType.Executions executions = new BuildInfoType.Executions();
- executions.getExecution().addAll( completedExecutions );
- return executions;
- }
-
public BuildInfo( BuildInfoType buildInfo, CacheSource source )
{
this.dto = buildInfo;
this.source = source;
}
- public static BuildInfoType.Goals createGoals( List<String> list )
- {
- BuildInfoType.Goals goals = new BuildInfoType.Goals();
- goals.getGoal().addAll( list );
- return goals;
- }
-
- public static BuildInfoType.AttachedArtifacts createAttachedArtifacts( List<Artifact> artifacts,
- HashAlgorithm algorithm ) throws IOException
+ public static List<ArtifactType> createAttachedArtifacts( List<Artifact> artifacts,
+ HashAlgorithm algorithm ) throws IOException
{
- BuildInfoType.AttachedArtifacts attachedArtifacts = new BuildInfoType.AttachedArtifacts();
+ List<ArtifactType> attachedArtifacts = new ArrayList<>();
for ( Artifact artifact : artifacts )
{
final ArtifactType dto = DtoUtils.createDto( artifact );
@@ -127,7 +104,7 @@ public class BuildInfo
{
dto.setFileHash( algorithm.hash( artifact.getFile().toPath() ) );
}
- attachedArtifacts.getArtifact().add( dto );
+ attachedArtifacts.add( dto );
}
return attachedArtifacts;
}
@@ -148,12 +125,15 @@ public class BuildInfo
private boolean hasCompletedExecution( String mojoExecutionKey )
{
- final List<CompletedExecutionType> completedExecutions = dto.getExecutions().getExecution();
- for ( CompletedExecutionType completedExecution : completedExecutions )
+ final List<CompletedExecutionType> completedExecutions = dto.getExecutions();
+ if ( dto.getExecutions() != null )
{
- if ( StringUtils.equals( completedExecution.getExecutionKey(), mojoExecutionKey ) )
+ for ( CompletedExecutionType completedExecution : completedExecutions )
{
- return true;
+ if ( StringUtils.equals( completedExecution.getExecutionKey(), mojoExecutionKey ) )
+ {
+ return true;
+ }
}
}
return false;
@@ -168,12 +148,12 @@ public class BuildInfo
public CompletedExecutionType findMojoExecutionInfo( MojoExecution mojoExecution )
{
- if ( !dto.isSetExecutions() )
+ if ( dto.getExecutions() == null )
{
return null;
}
- final List<CompletedExecutionType> executions = dto.getExecutions().getExecution();
+ final List<CompletedExecutionType> executions = dto.getExecutions();
for ( CompletedExecutionType execution : executions )
{
if ( StringUtils.equals( execution.getExecutionKey(), mojoExecutionKey( mojoExecution ) ) )
@@ -196,9 +176,9 @@ public class BuildInfo
public List<ArtifactType> getAttachedArtifacts()
{
- if ( dto.isSetAttachedArtifacts() )
+ if ( dto.getAttachedArtifacts() != null )
{
- return dto.getAttachedArtifacts().getArtifact();
+ return dto.getAttachedArtifacts();
}
return Collections.emptyList();
}
@@ -210,7 +190,7 @@ public class BuildInfo
public String getHighestCompletedGoal()
{
- return Iterables.getLast( dto.getGoals().getGoal() );
+ return Iterables.getLast( dto.getGoals() );
}
public List<MojoExecution> getCachedSegment( List<MojoExecution> mojoExecutions )
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 2f5137d..e07ce6a 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
@@ -22,9 +22,9 @@ package org.apache.maven.caching.xml;
import org.apache.maven.caching.PluginScanConfig;
import org.apache.maven.caching.checksum.MultimoduleDiscoveryStrategy;
import org.apache.maven.caching.hash.HashFactory;
-import org.apache.maven.caching.jaxb.PathSetType;
-import org.apache.maven.caching.jaxb.PropertyNameType;
-import org.apache.maven.caching.jaxb.TrackedPropertyType;
+import org.apache.maven.caching.domain.Include;
+import org.apache.maven.caching.domain.PropertyNameType;
+import org.apache.maven.caching.domain.TrackedPropertyType;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginExecution;
@@ -62,7 +62,7 @@ public interface CacheConfig
String getDefaultGlob();
@Nonnull
- List<PathSetType.Include> getGlobalIncludePaths();
+ List<Include> getGlobalIncludePaths();
@Nonnull
List<String> getGlobalExcludePaths();
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 9dd0e85..7946942 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
@@ -26,21 +26,25 @@ import org.apache.maven.caching.DefaultPluginScanConfig;
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.Include;
+import org.apache.maven.caching.domain.Local;
+import org.apache.maven.caching.domain.ProjectDiscoveryStrategy;
+import org.apache.maven.caching.domain.Remote;
import org.apache.maven.caching.hash.HashFactory;
-import org.apache.maven.caching.jaxb.CacheType;
-import org.apache.maven.caching.jaxb.ConfigurationType;
-import org.apache.maven.caching.jaxb.CoordinatesBaseType;
-import org.apache.maven.caching.jaxb.ExecutablesType;
-import org.apache.maven.caching.jaxb.ExecutionConfigurationScanType;
-import org.apache.maven.caching.jaxb.ExecutionControlType;
-import org.apache.maven.caching.jaxb.ExecutionIdsListType;
-import org.apache.maven.caching.jaxb.GoalReconciliationType;
-import org.apache.maven.caching.jaxb.GoalsListType;
-import org.apache.maven.caching.jaxb.PathSetType;
-import org.apache.maven.caching.jaxb.PluginConfigurationScanType;
-import org.apache.maven.caching.jaxb.PluginSetType;
-import org.apache.maven.caching.jaxb.PropertyNameType;
-import org.apache.maven.caching.jaxb.TrackedPropertyType;
+import org.apache.maven.caching.domain.CacheType;
+import org.apache.maven.caching.domain.ConfigurationType;
+import org.apache.maven.caching.domain.CoordinatesBaseType;
+import org.apache.maven.caching.domain.ExecutablesType;
+import org.apache.maven.caching.domain.ExecutionConfigurationScanType;
+import org.apache.maven.caching.domain.ExecutionControlType;
+import org.apache.maven.caching.domain.ExecutionIdsListType;
+import org.apache.maven.caching.domain.GoalReconciliationType;
+import org.apache.maven.caching.domain.GoalsListType;
+import org.apache.maven.caching.domain.PluginConfigurationScanType;
+import org.apache.maven.caching.domain.PluginSetType;
+import org.apache.maven.caching.domain.PropertyNameType;
+import org.apache.maven.caching.domain.TrackedPropertyType;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginExecution;
@@ -202,20 +206,20 @@ public class CacheConfigImpl implements CacheConfig
{
return true;
}
- return cacheConfig.isSetExecutionControl() && cacheConfig.getExecutionControl().isSetReconcile()
+ return cacheConfig.getExecutionControl() != null && cacheConfig.getExecutionControl().getReconcile() != null
&& cacheConfig.getExecutionControl().getReconcile().isLogAllProperties();
}
private GoalReconciliationType findReconciliationConfig( MojoExecution mojoExecution )
{
- if ( !cacheConfig.isSetExecutionControl() )
+ if ( cacheConfig.getExecutionControl() == null )
{
return null;
}
final ExecutionControlType executionControl = cacheConfig.getExecutionControl();
- if ( !executionControl.isSetReconcile() )
+ if ( executionControl.getReconcile() == null )
{
return null;
}
@@ -276,7 +280,7 @@ public class CacheConfigImpl implements CacheConfig
checkInitializedState();
final PluginConfigurationScanType pluginConfig = findPluginScanConfig( plugin );
- if ( pluginConfig != null && pluginConfig.isSetEffectivePom() )
+ if ( pluginConfig != null && pluginConfig.getEffectivePom() != null )
{
return pluginConfig.getEffectivePom().getExcludeProperty();
}
@@ -286,7 +290,7 @@ public class CacheConfigImpl implements CacheConfig
private PluginConfigurationScanType findPluginScanConfig( Plugin plugin )
{
- if ( !cacheConfig.isSetInput() )
+ if ( cacheConfig.getInput() == null )
{
return null;
}
@@ -305,7 +309,7 @@ public class CacheConfigImpl implements CacheConfig
private boolean isPluginMatch( Plugin plugin, CoordinatesBaseType pluginConfig )
{
return StringUtils.equals( pluginConfig.getArtifactId(),
- plugin.getArtifactId() ) && ( !pluginConfig.isSetGroupId() || StringUtils.equals(
+ plugin.getArtifactId() ) && ( pluginConfig.getGroupId() == null || StringUtils.equals(
pluginConfig.getGroupId(), plugin.getGroupId() ) );
}
@@ -316,7 +320,7 @@ public class CacheConfigImpl implements CacheConfig
{
checkInitializedState();
final PluginConfigurationScanType pluginConfig = findPluginScanConfig( plugin );
- if ( pluginConfig == null || !pluginConfig.isSetDirScan() )
+ if ( pluginConfig == null || pluginConfig.getDirScan() == null )
{
return new DefaultPluginScanConfig();
}
@@ -335,7 +339,7 @@ public class CacheConfigImpl implements CacheConfig
{
final ExecutionConfigurationScanType executionScanConfig = findExecutionScanConfig( exec,
pluginScanConfig.getExecution() );
- if ( executionScanConfig != null && executionScanConfig.isSetDirScan() )
+ if ( executionScanConfig != null && executionScanConfig.getDirScan() != null )
{
return new PluginScanConfigImpl( executionScanConfig.getDirScan() );
}
@@ -373,7 +377,7 @@ public class CacheConfigImpl implements CacheConfig
@Nonnull
@Override
- public List<PathSetType.Include> getGlobalIncludePaths()
+ public List<Include> getGlobalIncludePaths()
{
checkInitializedState();
return cacheConfig.getInput().getGlobal().getInclude();
@@ -392,9 +396,9 @@ public class CacheConfigImpl implements CacheConfig
public MultimoduleDiscoveryStrategy getMultimoduleDiscoveryStrategy()
{
checkInitializedState();
- final ConfigurationType.ProjectDiscoveryStrategy projectDiscoveryStrategy =
+ final ProjectDiscoveryStrategy projectDiscoveryStrategy =
cacheConfig.getConfiguration().getProjectDiscoveryStrategy();
- if ( projectDiscoveryStrategy.isSetSpecificVersion() )
+ if ( projectDiscoveryStrategy.getSpecificVersion() != null )
{
return new SentinelVersionStartegy( projectDiscoveryStrategy.getSpecificVersion() );
}
@@ -413,7 +417,7 @@ public class CacheConfigImpl implements CacheConfig
public boolean canIgnore( MojoExecution mojoExecution )
{
checkInitializedState();
- if ( !cacheConfig.isSetExecutionControl() || !cacheConfig.getExecutionControl().isSetIgnoreMissing() )
+ if ( cacheConfig.getExecutionControl() == null || cacheConfig.getExecutionControl().getIgnoreMissing() == null )
{
return false;
}
@@ -425,7 +429,7 @@ public class CacheConfigImpl implements CacheConfig
public boolean isForcedExecution( MojoExecution execution )
{
checkInitializedState();
- if ( !cacheConfig.isSetExecutionControl() || !cacheConfig.getExecutionControl().isSetRunAlways() )
+ if ( cacheConfig.getExecutionControl() == null || cacheConfig.getExecutionControl().getRunAlways() == null )
{
return false;
}
@@ -524,14 +528,14 @@ public class CacheConfigImpl implements CacheConfig
public int getMaxLocalBuildsCached()
{
checkInitializedState();
- return getLocal().getMaxBuildsCached().intValue();
+ return getLocal().getMaxBuildsCached();
}
@Override
public List<String> getAttachedOutputs()
{
checkInitializedState();
- final ConfigurationType.AttachedOutputs attachedOutputs = getConfiguration().getAttachedOutputs();
+ final AttachedOutputs attachedOutputs = getConfiguration().getAttachedOutputs();
return attachedOutputs == null ? Collections.<String>emptyList() : attachedOutputs.getDirName();
}
@@ -545,7 +549,7 @@ public class CacheConfigImpl implements CacheConfig
private List<Pattern> compileExcludePatterns()
{
- if ( cacheConfig.isSetOutput() && cacheConfig.getOutput().isSetExclude() )
+ if ( cacheConfig.getOutput() != null && cacheConfig.getOutput().getExclude() != null )
{
List<Pattern> patterns = new ArrayList<>();
for ( String pattern : cacheConfig.getOutput().getExclude().getPattern() )
@@ -557,12 +561,12 @@ public class CacheConfigImpl implements CacheConfig
return Collections.emptyList();
}
- private ConfigurationType.Remote getRemote()
+ private Remote getRemote()
{
return getConfiguration().getRemote();
}
- private ConfigurationType.Local getLocal()
+ private Local getLocal()
{
return getConfiguration().getLocal();
}
diff --git a/maven-core/src/main/java/org/apache/maven/caching/xml/DtoUtils.java b/maven-core/src/main/java/org/apache/maven/caching/xml/DtoUtils.java
index a2810ab..7bd2d2b 100644
--- a/maven-core/src/main/java/org/apache/maven/caching/xml/DtoUtils.java
+++ b/maven-core/src/main/java/org/apache/maven/caching/xml/DtoUtils.java
@@ -23,14 +23,16 @@ import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.caching.ProjectUtils;
-import org.apache.maven.caching.jaxb.ArtifactType;
-import org.apache.maven.caching.jaxb.CompletedExecutionType;
-import org.apache.maven.caching.jaxb.DigestItemType;
-import org.apache.maven.caching.jaxb.PropertyValueType;
-import org.apache.maven.caching.jaxb.TrackedPropertyType;
+import org.apache.maven.caching.domain.ArtifactType;
+import org.apache.maven.caching.domain.CompletedExecutionType;
+import org.apache.maven.caching.domain.DigestItemType;
+import org.apache.maven.caching.domain.PropertyValueType;
+import org.apache.maven.caching.domain.TrackedPropertyType;
import org.apache.maven.model.Dependency;
import javax.annotation.Nonnull;
+
+import java.util.ArrayList;
import java.util.List;
import static org.apache.maven.caching.checksum.KeyUtils.getArtifactKey;
@@ -43,12 +45,12 @@ public class DtoUtils
public static String findPropertyValue( String propertyName, CompletedExecutionType completedExecution )
{
- final CompletedExecutionType.Configuration configuration = completedExecution.getConfiguration();
+ final List<PropertyValueType> configuration = completedExecution.getConfiguration();
if ( configuration == null )
{
return null;
}
- final List<PropertyValueType> properties = configuration.getProperty();
+ final List<PropertyValueType> properties = configuration;
for ( PropertyValueType property : properties )
{
if ( StringUtils.equals( propertyName, property.getName() ) )
@@ -124,7 +126,7 @@ public class DtoUtils
{
if ( execution.getConfiguration() == null )
{
- execution.setConfiguration( new CompletedExecutionType.Configuration() );
+ execution.setConfiguration( new ArrayList<>() );
}
final PropertyValueType valueType = new PropertyValueType();
valueType.setName( propertyName );
@@ -135,7 +137,7 @@ public class DtoUtils
final String valueText = String.valueOf( value );
valueType.setValue( StringUtils.remove( valueText, baseDirPath ) );
valueType.setTracked( tracked );
- execution.getConfiguration().getProperty().add( valueType );
+ execution.getConfiguration().add( valueType );
}
public static boolean containsAllProperties(
@@ -147,12 +149,12 @@ public class DtoUtils
return true;
}
- if ( !cachedExecution.isSetConfiguration() )
+ if ( cachedExecution.getConfiguration() == null )
{
return false;
}
- final List<PropertyValueType> executionProperties = cachedExecution.getConfiguration().getProperty();
+ final List<PropertyValueType> executionProperties = cachedExecution.getConfiguration();
for ( TrackedPropertyType trackedProperty : trackedProperties )
{
if ( !contains( executionProperties, trackedProperty.getPropertyName() ) )
@@ -178,42 +180,15 @@ public class DtoUtils
public static ArtifactType copy( ArtifactType artifact )
{
ArtifactType copy = new ArtifactType();
- if ( artifact.isSetArtifactId() )
- {
- copy.setArtifactId( artifact.getArtifactId() );
- }
- if ( artifact.isSetGroupId() )
- {
- copy.setGroupId( artifact.getGroupId() );
- }
- if ( artifact.isSetVersion() )
- {
- copy.setVersion( artifact.getVersion() );
- }
- if ( artifact.isSetType() )
- {
- copy.setType( artifact.getType() );
- }
- if ( artifact.isSetClassifier() )
- {
- copy.setClassifier( artifact.getClassifier() );
- }
- if ( artifact.isSetScope() )
- {
- copy.setScope( artifact.getScope() );
- }
- if ( artifact.isSetFileName() )
- {
- copy.setFileName( artifact.getFileName() );
- }
- if ( artifact.isSetFileHash() )
- {
- copy.setFileHash( artifact.getFileHash() );
- }
- if ( artifact.isSetFileSize() )
- {
- copy.setFileSize( artifact.getFileSize() );
- }
+ copy.setArtifactId( artifact.getArtifactId() );
+ copy.setGroupId( artifact.getGroupId() );
+ copy.setVersion( artifact.getVersion() );
+ copy.setType( artifact.getType() );
+ copy.setClassifier( artifact.getClassifier() );
+ copy.setScope( artifact.getScope() );
+ copy.setFileName( artifact.getFileName() );
+ copy.setFileHash( artifact.getFileHash() );
+ copy.setFileSize( artifact.getFileSize() );
return copy;
}
}
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 658c9d0..f63ffe6 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
@@ -19,27 +19,26 @@ package org.apache.maven.caching.xml;
* under the License.
*/
-import org.apache.maven.caching.jaxb.BuildDiffType;
-import org.apache.maven.caching.jaxb.BuildInfoType;
-import org.apache.maven.caching.jaxb.CacheReportType;
-import org.apache.maven.caching.jaxb.ObjectFactory;
+import org.apache.maven.caching.domain.CacheType;
+import org.apache.maven.caching.domain.io.xpp3.CacheConfigXpp3Reader;
+import org.apache.maven.caching.domain.io.xpp3.CacheConfigXpp3Writer;
+import org.apache.maven.caching.domain.io.xpp3.CacheDiffXpp3Reader;
+import org.apache.maven.caching.domain.io.xpp3.CacheDiffXpp3Writer;
+import org.apache.maven.caching.domain.io.xpp3.CacheDomainXpp3Reader;
+import org.apache.maven.caching.domain.BuildDiffType;
+import org.apache.maven.caching.domain.BuildInfoType;
+import org.apache.maven.caching.domain.CacheReportType;
+import org.apache.maven.caching.domain.io.xpp3.CacheDomainXpp3Writer;
+import org.apache.maven.caching.domain.io.xpp3.CacheReportXpp3Reader;
+import org.apache.maven.caching.domain.io.xpp3.CacheReportXpp3Writer;
import org.codehaus.plexus.component.annotations.Component;
-import org.xml.sax.SAXException;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-import javax.xml.XMLConstants;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
-import java.io.InputStream;
+import java.io.IOException;
+import java.nio.file.Files;
/**
* XmlService
@@ -48,98 +47,94 @@ import java.io.InputStream;
public class XmlService
{
- private final ObjectFactory objectFactory;
- private final JAXBContext jaxbContext;
- private final Schema schema;
-
- public XmlService() throws JAXBException, SAXException
+ public byte[] toBytes( CacheType cache ) throws IOException
{
- objectFactory = new ObjectFactory();
- jaxbContext = JAXBContext.newInstance( "org.apache.maven.caching.jaxb", XmlService.class.getClassLoader() );
-
- SchemaFactory sf = SchemaFactory.newInstance( XMLConstants.W3C_XML_SCHEMA_NS_URI );
- final InputStream domainSchemaStream = getResourceAsStream( "cache-domain.xsd" );
- final Source domainSchema = new StreamSource( domainSchemaStream );
- final InputStream configSchemaStream = getResourceAsStream( "cache-config.xsd" );
- final Source configSchema = new StreamSource( configSchemaStream );
- schema = sf.newSchema( new Source[] {domainSchema, configSchema} );
+ try ( ByteArrayOutputStream baos = new ByteArrayOutputStream() )
+ {
+ new CacheConfigXpp3Writer().write( baos, cache );
+ return baos.toByteArray();
+ }
}
- public byte[] toBytes( BuildInfoType buildInfo )
+ public byte[] toBytes( BuildInfoType buildInfo ) throws IOException
{
- return serializeXml( objectFactory.createBuild( buildInfo ) );
+ try ( ByteArrayOutputStream baos = new ByteArrayOutputStream() )
+ {
+ new CacheDomainXpp3Writer().write( baos, buildInfo );
+ return baos.toByteArray();
+ }
}
- public byte[] toBytes( BuildDiffType diff )
+ public byte[] toBytes( BuildDiffType diff ) throws IOException
{
- return serializeXml( objectFactory.createDiff( diff ) );
+ try ( ByteArrayOutputStream baos = new ByteArrayOutputStream() )
+ {
+ new CacheDiffXpp3Writer().write( baos, diff );
+ return baos.toByteArray();
+ }
}
- public byte[] toBytes( CacheReportType cacheReportType )
+ public byte[] toBytes( CacheReportType cacheReportType ) throws IOException
{
-
- return serializeXml( objectFactory.createReport( cacheReportType ) );
+ try ( ByteArrayOutputStream baos = new ByteArrayOutputStream() )
+ {
+ new CacheReportXpp3Writer().write( baos, cacheReportType );
+ return baos.toByteArray();
+ }
}
- private byte[] serializeXml( JAXBElement<?> element )
+ public <T> T fromFile( Class<T> clazz, File file ) throws IOException, XmlPullParserException
{
- try
+ if ( clazz == BuildInfoType.class )
{
- Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
- jaxbMarshaller.setSchema( schema );
- // output pretty printed
- jaxbMarshaller.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, true );
- jaxbMarshaller.setProperty( Marshaller.JAXB_ENCODING, "UTF-8" );
- final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- jaxbMarshaller.marshal( element, baos );
- return baos.toByteArray();
+ return clazz.cast( new CacheDomainXpp3Reader().read( Files.newInputStream( file.toPath() ) ) );
}
- catch ( Exception e )
+ else if ( clazz == CacheType.class )
{
- throw new RuntimeException( "Errors in jaxb serialization: " + e.toString(), e );
+ return clazz.cast( new CacheConfigXpp3Reader().read( Files.newInputStream( file.toPath() ) ) );
}
- }
-
- public <T> T fromFile( Class<T> clazz, File file )
- {
-
- try
+ else if ( clazz == BuildDiffType.class )
{
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- unmarshaller.setSchema( schema );
- JAXBElement<T> result = (JAXBElement<T>) unmarshaller.unmarshal( file );
- return result.getValue();
+ return clazz.cast( new CacheDiffXpp3Reader().read( Files.newInputStream( file.toPath() ) ) );
}
- catch ( Exception e )
+ else if ( clazz == CacheReportType.class )
{
- throw new RuntimeException( "Errors in jaxb serialization: " + e.toString(), e );
+ return clazz.cast( new CacheReportXpp3Reader().read( Files.newInputStream( file.toPath() ) ) );
}
- }
-
- public static InputStream getResourceAsStream( String name )
- {
- ClassLoader cl = XmlService.class.getClassLoader();
- if ( cl == null )
+ else
{
- // A system class.
- return ClassLoader.getSystemResourceAsStream( name );
+ throw new IllegalArgumentException( "Unsupported type " + clazz );
}
- return cl.getResourceAsStream( name );
}
public <T> T fromBytes( Class<T> clazz, byte[] bytes )
{
try
{
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- unmarshaller.setSchema( schema );
- JAXBElement<T> result = (JAXBElement<T>) unmarshaller.unmarshal( new ByteArrayInputStream( bytes ) );
- return result.getValue();
-
+ if ( clazz == BuildInfoType.class )
+ {
+ return clazz.cast( new CacheDomainXpp3Reader().read( new ByteArrayInputStream( bytes ) ) );
+ }
+ else if ( clazz == CacheType.class )
+ {
+ return clazz.cast( new CacheConfigXpp3Reader().read( new ByteArrayInputStream( bytes ) ) );
+ }
+ else if ( clazz == BuildDiffType.class )
+ {
+ return clazz.cast( new CacheDiffXpp3Reader().read( new ByteArrayInputStream( bytes ) ) );
+ }
+ else if ( clazz == CacheReportType.class )
+ {
+ return clazz.cast( new CacheReportXpp3Reader().read( new ByteArrayInputStream( bytes ) ) );
+ }
+ else
+ {
+ throw new IllegalArgumentException( "Unsupported type " + clazz );
+ }
}
- catch ( Exception e )
+ catch ( IOException | XmlPullParserException e )
{
- throw new RuntimeException( "Errors in jaxb serialization: " + e.toString(), e );
+ throw new RuntimeException( "Unable to parse cache xml element", e );
}
}
}
diff --git a/maven-core/src/main/mdo/cache-config.mdo b/maven-core/src/main/mdo/cache-config.mdo
new file mode 100644
index 0000000..dfd4bf6
--- /dev/null
+++ b/maven-core/src/main/mdo/cache-config.mdo
@@ -0,0 +1,1390 @@
+<!--
+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.
+-->
+
+<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:config">
+ <id>cache-config</id>
+ <name>CacheConfig</name>
+ <description><![CDATA[
+ ]]></description>
+
+ <defaults>
+ <default>
+ <key>package</key>
+ <value>org.apache.maven.caching.domain</value>
+ </default>
+ </defaults>
+
+ <classes>
+
+ <!--
+ <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>
+ -->
+ <class rootElement="true">
+ <name>CacheType</name>
+ <fields>
+ <field>
+ <name>configuration</name>
+ <association>
+ <type>ConfigurationType</type>
+ </association>
+ </field>
+ <field>
+ <name>input</name>
+ <association>
+ <type>InputType</type>
+ </association>
+ </field>
+ <field>
+ <name>output</name>
+ <association>
+ <type>OutputType</type>
+ </association>
+ </field>
+ <field>
+ <name>executionControl</name>
+ <association>
+ <type>ExecutionControlType</type>
+ </association>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+ <class>
+ <name>Remote</name>
+ <fields>
+ <field>
+ <name>url</name>
+ <type>String</type>
+ <description>address of remote cache</description>
+ </field>
+ <field xml.attribute="true">
+ <name>enabled</name>
+ <type>boolean</type>
+ <defaultValue>true</defaultValue>
+ </field>
+ <field xml.attribute="true">
+ <name>saveToRemote</name>
+ <type>boolean</type>
+ <defaultValue>false</defaultValue>
+ <description>Save output to remote cache. Recommended to enable on CI agents only.</description>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+
+ <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>
+ -->
+ <class>
+ <name>ConfigurationType</name>
+ <fields>
+ <field>
+ <name>enabled</name>
+ <type>boolean</type>
+ </field>
+ <field>
+ <name>hashAlgorithm</name>
+ <type>String</type>
+ <description>One of XX, XXMM, SHA-1, SHA-256, SHA-384, SHA-512</description>
+ </field>
+ <field>
+ <name>validateXml</name>
+ <type>boolean</type>
+ <defaultValue>true</defaultValue>
+ <description>Validate cache config and builds metadata against xsd.</description>
+ </field>
+ <field>
+ <name>projectDiscoveryStrategy</name>
+ <association>
+ <type>ProjectDiscoveryStrategy</type>
+ </association>
+ <description>Specifies how to identify belonging to a cached project then submodule is being build.</description>
+ </field>
+ <field>
+ <name>remote</name>
+ <association>
+ <type>Remote</type>
+ </association>
+ </field>
+ <field>
+ <name>attachedOutputs</name>
+ <association>
+ <type>AttachedOutputs</type>
+ </association>
+ </field>
+ <field>
+ <name>local</name>
+ <association>
+ <type>Local</type>
+ </association>
+ </field>
+ <field>
+ <name>debug</name>
+ <association>
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>FileHash (causes file hash is saved in build metadata) or
+ EffectivePom (causes effective pom info is saved in build metadata)</description>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+ <class>
+ <name>ProjectDiscoveryStrategy</name>
+ <fields>
+ <field>
+ <name>specificVersion</name>
+ <type>String</type>
+ <description>
+ Any project dependency this this version will be considered cache eligible and will
+ be processed cache aware
+ </description>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+ <class>
+ <name>AttachedOutputs</name>
+ <fields>
+ <field>
+ <name>dirName</name>
+ <association>
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>Directory name in build output directory to attach to cached artifacts</description>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+ <class>
+ <name>Local</name>
+ <fields>
+ <field>
+ <name>maxBuildsCached</name>
+ <type>int</type>
+ <defaultValue>3</defaultValue>
+ <description>Maximum number of cached build per artifact in local cache. First created cache (the
+ oldest) is evicted if breached.</description>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+ <class>
+ <name>InputType</name>
+ <fields>
+ <field>
+ <name>global</name>
+ <association>
+ <type>PathSetType</type>
+ </association>
+ <description>Global input calculation rules applicable to all projects and plugins in the build</description>
+ </field>
+ <field>
+ <name>plugin</name>
+ <association>
+ <type>PluginConfigurationScanType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>Plugin specific input calculation rules</description>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+ <class>
+ <name>PluginConfigurationScanType</name>
+ <superClass>CoordinatesBaseType</superClass>
+ <fields>
+ <field>
+ <name>effectivePom</name>
+ <association>
+ <type>EffectivePom</type>
+ </association>
+ <description>Effective pom calculation rules</description>
+ </field>
+ <field>
+ <name>dirScan</name>
+ <association>
+ <type>DirScanConfigType</type>
+ </association>
+ <description>Specifies plugin level rules of configuration processing in search of referenced source files</description>
+ </field>
+ <field>
+ <name>execution</name>
+ <association>
+ <type>ExecutionConfigurationScanType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>Specifies execution specific configuration processing in search of referenced source files</description>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+ <class>
+ <name>EffectivePom</name>
+ <fields>
+ <field>
+ <name>excludeProperty</name>
+ <association>
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>Plugin configuration property should be excluded from effective pom calculation</description>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+ <class>
+ <name>ExecutionConfigurationScanType</name>
+ <fields>
+ <field>
+ <name>execId</name>
+ <association>
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ <field>
+ <name>dirScan</name>
+ <association>
+ <type>DirScanConfigType</type>
+ </association>
+ <description>Specifies rules of configuration processing in search of referenced source files</description>
+ </field>
+ <field xml.attribute="true">
+ <name>ignoreParentConfig</name>
+ <type>boolean</type>
+ <description>ignore parent config or inherit/merge</description>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <xs:complexType name="TagScanConfigType">
+ <xs:simpleContent>
+ <xs:extension base="c:TagNameType">
+ <xs:attributeGroup ref="c:pathScanAttrGroup"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ -->
+ <class>
+ <name>TagScanConfigType</name>
+ <superClass>TagNameType</superClass>
+ <fields>
+ <field xml.attribute="true">
+ <name>recursive</name>
+ <type>boolean</type>
+ <defaultValue>true</defaultValue>
+ </field>
+ <field xml.attribute="true">
+ <name>glob</name>
+ <type>String</type>
+ <defaultValue>*</defaultValue>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+ <class>
+ <name>DirScanConfigType</name>
+ <fields>
+ <field>
+ <name>include</name>
+ <association>
+ <type>TagScanConfigType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>Forces cache to treat property value as input and include in calculation. If set, only included
+ properties will be takein in calculation (whitelist)</description>
+ </field>
+ <field>
+ <name>exclude</name>
+ <association>
+ <type>TagNameType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>Tag to exclude when scanning plugin configuration for input files (blacklist)</description>
+ </field>
+ <field>
+ <name>tagScanConfig</name>
+ <association>
+ <type>TagScanConfigType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>Additional processing rules for non-blacklisted tags</description>
+ </field>
+ <field xml.attribute="true">
+ <name>ignoreParent</name>
+ <type>boolean</type>
+ <defaultValue>false</defaultValue>
+ <description>Ignore parent settings or inherit and merge</description>
+ </field>
+ <field xml.attribute="true">
+ <name>mode</name>
+ <type>String</type>
+ <description>
+ Either 'auto' (scan directory accordingly to cache implementation) or 'skip' (skip directory).
+ </description>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+ <class>
+ <name>OutputType</name>
+ <fields>
+ <field>
+ <name>exclude</name>
+ <association>
+ <type>OutputTypeExclude</type>
+ </association>
+ <description>Patterns to exclude output artifacts applicable to all projects in the build</description>
+ </field>
+ </fields>
+ </class>
+
+ <class>
+ <name>OutputTypeExclude</name>
+ <fields>
+ <field>
+ <name>pattern</name>
+ <association>
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+ <class>
+ <name>PathSetType</name>
+ <fields>
+ <field>
+ <name>glob</name>
+ <type>String</type>
+ <defaultValue>*</defaultValue>
+ </field>
+ <field>
+ <name>include</name>
+ <association>
+ <type>Include</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ <field>
+ <name>exclude</name>
+ <association>
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ </fields>
+ </class>
+ <class>
+ <name>Include</name>
+ <fields>
+ <field xml.content="true">
+ <name>value</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>recursive</name>
+ <type>boolean</type>
+ <defaultValue>true</defaultValue>
+ </field>
+ <field xml.attribute="true">
+ <name>glob</name>
+ <type>String</type>
+ <defaultValue>*</defaultValue>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <xx 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 xx>
+ -->
+
+ <!--
+ <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>
+ -->
+
+ <class>
+ <name>GoalReconciliationType</name>
+ <superClass>GoalIdType</superClass>
+ <fields>
+ <field>
+ <name>reconcile</name>
+ <association>
+ <type>TrackedPropertyType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ <field>
+ <name>log</name>
+ <association>
+ <type>PropertyNameType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>Specify property which should be logged to build metadata for exploration</description>
+ </field>
+ <field>
+ <name>nolog</name>
+ <association>
+ <type>PropertyNameType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>Specify property which should not be logged</description>
+ </field>
+ <field>
+ <name>logAll</name>
+ <type>boolean</type>
+ <defaultValue>true</defaultValue>
+ <description>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
+ </description>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+
+ <class>
+ <name>ExecutionControlType</name>
+ <fields>
+ <field>
+ <name>runAlways</name>
+ <association>
+ <type>ExecutablesType</type>
+ </association>
+ <description>Specify which plugin should run always if present in build regardless of cached status</description>
+ </field>
+ <field>
+ <name>ignoreMissing</name>
+ <association>
+ <type>ExecutablesType</type>
+ </association>
+ <description>
+ 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
+ </description>
+ </field>
+ <field>
+ <name>reconcile</name>
+ <association>
+ <type>Reconcile</type>
+ </association>
+ <description>Specify which plugin should run always if present in build regardless of cached status</description>
+
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+ <class>
+ <name>Reconcile</name>
+ <fields>
+ <field>
+ <name>plugin</name>
+ <association>
+ <type>GoalReconciliationType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>Reconciliation rules for plugin properties which might be affected by command line flags, etc</description>
+ </field>
+ <field xml.attribute="true">
+ <name>logAllProperties</name>
+ <type>boolean</type>
+ <defaultValue>true</defaultValue>
+ <description>
+ 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/>
+ </description>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+
+ <class>
+ <name>ExecutablesType</name>
+ <fields>
+ <field>
+ <name>plugin</name>
+ <association>
+ <type>PluginSetType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>Specify which executions should run always if present in build regardless of cached status</description>
+ </field>
+ <field>
+ <name>execution</name>
+ <association>
+ <type>ExecutionIdsListType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>Specify which executions should run always if present in build regardless of cached status</description>
+ </field>
+ <field>
+ <name>goals</name>
+ <association>
+ <type>GoalsListType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>Specify which goals should run always if present in build regardless of cached status</description>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+
+ <class>
+ <name>GoalsListType</name>
+ <superClass>CoordinatesBaseType</superClass>
+ <fields>
+ <field>
+ <name>goal</name>
+ <association>
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>Goals identification</description>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+
+ <class>
+ <name>GoalIdType</name>
+ <superClass>CoordinatesBaseType</superClass>
+ <fields>
+ <field xml.attribute="true">
+ <name>goal</name>
+ <type>String</type>
+ <required>true</required>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+
+ <class>
+ <name>ExecutionIdsListType</name>
+ <superClass>CoordinatesBaseType</superClass>
+ <fields>
+ <field>
+ <name>execId</name>
+ <association>
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>Executions ids list with plugin identifier</description>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <xs:complexType name="PluginSetType">
+ <xs:complexContent>
+ <xs:extension base="c:CoordinatesBaseType"/>
+ </xs:complexContent>
+ </xs:complexType>
+ -->
+
+ <class>
+ <name>PluginSetType</name>
+ <superClass>CoordinatesBaseType</superClass>
+ </class>
+
+ <!--
+ <xs:complexType name="CoordinatesBaseType">
+ <xs:attribute name="groupId" type="xs:string"/>
+ <xs:attribute name="artifactId" type="xs:string" use="required"/>
+ </xs:complexType>
+ -->
+
+ <class>
+ <name>CoordinatesBaseType</name>
+ <fields>
+ <field>
+ <name>groupId</name>
+ <type>String</type>
+ </field>
+ <field>
+ <name>artifactId</name>
+ <type>String</type>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+
+ <class>
+ <name>TagNameType</name>
+ <fields>
+ <field>
+ <name>tagName</name>
+ <type>String</type>
+ <required>true</required>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+
+ <class>
+ <name>PropertyNameType</name>
+ <fields>
+ <field xml.content="true">
+ <name>value</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>propertyName</name>
+ <type>String</type>
+ </field>
+ </fields>
+ </class>
+
+ <!--
+ <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>
+ -->
+
+ <class>
+ <name>TrackedPropertyType</name>
+ <fields>
+ <field xml.content="true">
+ <name>value</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>propertyName</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>skipValue</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>defaultValue</name>
+ <type>String</type>
+ </field>
+ </fields>
+ </class>
+ </classes>
+
+ <!--
+ <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>
+
+
+
+ -->
+
+</model>
diff --git a/maven-core/src/main/mdo/cache-diff.mdo b/maven-core/src/main/mdo/cache-diff.mdo
new file mode 100644
index 0000000..e2a9cfe
--- /dev/null
+++ b/maven-core/src/main/mdo/cache-diff.mdo
@@ -0,0 +1,109 @@
+<!--
+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.
+-->
+
+<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">
+ <id>cache-diff</id>
+ <name>CacheDiff</name>
+ <description><![CDATA[
+ ]]></description>
+ <defaults>
+ <default>
+ <key>package</key>
+ <value>org.apache.maven.caching.domain</value>
+ </default>
+ </defaults>
+ <classes>
+
+ <!--xs:complexType name="BuildDiffType">
+ <xs:sequence>
+ <xs:element name="mismatch" type="d:MismatchType" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType-->
+
+ <class rootElement="true">
+ <name>BuildDiffType</name>
+ <fields>
+ <field>
+ <name>mismatch</name>
+ <association>
+ <type>MismatchType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ </fields>
+ </class>
+
+ <!--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-->
+
+ <class>
+ <name>MismatchType</name>
+ <fields>
+ <field>
+ <name>detail</name>
+ <association>
+ <type>MismatchDetailType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ <field xml.attribute="true">
+ <name>item</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>current</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>baseline</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>reason</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>resolution</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>context</name>
+ <type>String</type>
+ </field>
+ </fields>
+ </class>
+
+ <!--xs:complexType name="MismatchDetailType"/-->
+ <class>
+ <name>MismatchDetailType</name>
+ </class>
+
+ </classes>
+</model>
diff --git a/maven-core/src/main/mdo/cache-domain.mdo b/maven-core/src/main/mdo/cache-domain.mdo
index cb0ba6d..43c3530 100644
--- a/maven-core/src/main/mdo/cache-domain.mdo
+++ b/maven-core/src/main/mdo/cache-domain.mdo
@@ -18,7 +18,8 @@ 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">
+ 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">
<id>cache-domain</id>
<name>CacheDomain</name>
<description><![CDATA[
@@ -35,52 +36,61 @@ under the License.
<name>BuildInfoType</name>
<version>1.0.0+</version>
<description><![CDATA[Root element of the <code>extension.xml</code> file.]]></description>
- <!--xs:all-->
+ <!--xs:all-->
<fields>
+ <!-- xs:element name="cacheImplementationVersion" type="xs:string"/-->
<field>
<name>cacheImplementationVersion</name>
<version>1.0.0+</version>
<type>String</type>
- <description></description>
</field>
- <!--xs:element name="final" type="xs:boolean" minOccurs="0"/-->
- <!--field>
- <name>final</name>
+ <!--xs:element name="final" type="xs:boolean" minOccurs="0"/-->
+ <field>
+ <name>_final</name>
<version>1.0.0+</version>
<type>Boolean</type>
- <description></description>
- </field-->
- <!--xs:element name="hashFunction" type="xs:string"/-->
+ <alias>final</alias>
+ </field>
+ <!--xs:element name="hashFunction" type="xs:string"/-->
<field>
<name>hashFunction</name>
<version>1.0.0+</version>
<type>String</type>
- <description></description>
</field>
- <!--xs:element name="buildTime" type="xs:dateTime" minOccurs="0"/-->
- <!--xs:element name="buildServer" type="xs:string" minOccurs="0"/-->
+ <!--xs:element name="buildTime" type="xs:dateTime" minOccurs="0"/-->
+ <field>
+ <name>buildTime</name>
+ <version>1.0.0+</version>
+ <type>Date</type>
+ </field>
+ <!--xs:element name="buildServer" type="xs:string" minOccurs="0"/-->
<field>
<name>buildServer</name>
<version>1.0.0+</version>
<type>String</type>
- <description></description>
</field>
- <!--xs:element name="cacheImplementationVersion" type="xs:string"/-->
- <!--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="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-->
+ <field>
+ <name>scm</name>
+ <version>1.0.0+</version>
+ <association>
+ <type>Scm</type>
+ </association>
+ </field>
+ <!--xs:element name="goals">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="goal" type="xs:string" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element-->
<field>
<name>goals</name>
<version>1.0.0+</version>
@@ -90,7 +100,7 @@ under the License.
</association>
<description></description>
</field>
- <!--xs:element name="artifact" type="d:ArtifactType"/-->
+ <!--xs:element name="artifact" type="d:ArtifactType"/-->
<field>
<name>artifact</name>
<version>1.0.0+</version>
@@ -99,109 +109,137 @@ under the License.
</association>
<description></description>
</field>
- <!--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:element name="attachedArtifacts">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="artifact" type="d:ArtifactType" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element-->
+ <field>
+ <name>attachedArtifacts</name>
+ <association>
+ <type>ArtifactType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ <!--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-->
+ <field>
+ <name>executions</name>
+ <association>
+ <type>CompletedExecutionType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ <!--xs:element name="projectsInputInfo" type="d:ProjectsInputInfoType" minOccurs="0"/-->
+ <field>
+ <name>projectsInputInfo</name>
+ <association>
+ <type>ProjectsInputInfoType</type>
+ </association>
+ </field>
+ </fields>
+ </class>
+
+ <!--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-->
+ <class>
+ <name>Scm</name>
+ <fields>
+ <field>
+ <name>sourceBranch</name>
+ <type>String</type>
+ </field>
+ <field>
+ <name>revision</name>
+ <type>String</type>
+ </field>
</fields>
</class>
<!--xs:complexType name="ArtifactType"-->
<class>
<name>ArtifactType</name>
- <!--xs:sequence-->
+ <!--xs:sequence-->
<fields>
- <!--xs:element name="groupId" type="xs:string"/-->
+ <!--xs:element name="groupId" type="xs:string"/-->
<field>
<name>groupId</name>
- <version>1.0.0+</version>
<type>String</type>
- <description></description>
</field>
- <!--xs:element name="artifactId" type="xs:string"/-->
+ <!--xs:element name="artifactId" type="xs:string"/-->
<field>
<name>artifactId</name>
- <version>1.0.0+</version>
<type>String</type>
- <description></description>
</field>
- <!--xs:element name="version" type="xs:string"/-->
+ <!--xs:element name="version" type="xs:string"/-->
<field>
<name>version</name>
- <version>1.0.0+</version>
<type>String</type>
- <description></description>
</field>
- <!--xs:element name="classifier" type="xs:string" minOccurs="0"/-->
+ <!--xs:element name="classifier" type="xs:string" minOccurs="0"/-->
<field>
<name>classifier</name>
- <version>1.0.0+</version>
<type>String</type>
- <description></description>
</field>
- <!--xs:element name="type" type="xs:string"/-->
+ <!--xs:element name="type" type="xs:string"/-->
<field>
<name>type</name>
- <version>1.0.0+</version>
<type>String</type>
- <description></description>
</field>
- <!--xs:element name="scope" type="xs:string" minOccurs="0"/-->
+ <!--xs:element name="scope" type="xs:string" minOccurs="0"/-->
<field>
<name>scope</name>
- <version>1.0.0+</version>
<type>String</type>
- <description></description>
</field>
- <!--xs:element name="fileName" type="xs:string" minOccurs="0"/-->
+ <!--xs:element name="fileName" type="xs:string" minOccurs="0"/-->
<field>
<name>fileName</name>
- <version>1.0.0+</version>
<type>String</type>
- <description></description>
</field>
- <!--xs:element name="fileHash" type="xs:string" minOccurs="0"/-->
+ <!--xs:element name="fileHash" type="xs:string" minOccurs="0"/-->
<field>
<name>fileHash</name>
- <version>1.0.0+</version>
<type>String</type>
- <description></description>
</field>
- <!--xs:element name="fileSize" type="xs:nonNegativeInteger" minOccurs="0"/-->
+ <!--xs:element name="fileSize" type="xs:nonNegativeInteger" minOccurs="0"/-->
<!--field>
<name>fileSize</name>
- <version>1.0.0+</version>
<type>int</type>
- <description></description>
</field-->
- <!--/xs:sequence-->
+ <field>
+ <name>fileSize</name>
+ <type>long</type>
+ </field>
+ <!--/xs:sequence-->
</fields>
<!--/xs:complexType-->
</class>
@@ -218,25 +256,80 @@ under the License.
</xs:complexType>
</xs:element>
</xs:sequence>
- </xs:complexType>
+ </xs:complexType-->
+ <class>
+ <name>CompletedExecutionType</name>
+ <fields>
+ <field>
+ <name>executionKey</name>
+ <type>String</type>
+ </field>
+ <field>
+ <name>mojoClassName</name>
+ <type>String</type>
+ </field>
+ <field>
+ <name>configuration</name>
+ <association>
+ <type>PropertyValueType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ </fields>
+ </class>
- <xs:complexType name="PropertyValueType">
+ <!--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-->
- <xs:complexType name="ProjectsInputInfoType">
+ <class>
+ <name>PropertyValueType</name>
+ <fields>
+ <field xml.content="true">
+ <name>value</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>name</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>tracked</name>
+ <type>Boolean</type>
+ </field>
+ </fields>
+ </class>
+
+ <!--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-->
- <xs:complexType name="DigestItemType">
+ <class>
+ <name>ProjectsInputInfoType</name>
+ <fields>
+ <field>
+ <name>checksum</name>
+ <type>String</type>
+ </field>
+ <field>
+ <name>item</name>
+ <association>
+ <type>DigestItemType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ </fields>
+ </class>
+
+ <!--xs:complexType name="DigestItemType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="type" use="required" type="xs:string"/>
@@ -248,49 +341,45 @@ under the License.
<xs:attribute name="eol" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
- </xs:complexType>
+ </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>
+ <class>
+ <name>DigestItemType</name>
+ <fields>
+ <field xml.content="true">
+ <name>value</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>type</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>hash</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>fileChecksum</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>content</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>isText</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>charset</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true">
+ <name>eol</name>
+ <type>String</type>
+ </field>
+ </fields>
+ </class>
- <xs:complexType name="MismatchDetailType"/>
- -->
</classes>
</model>
diff --git a/maven-core/src/main/mdo/cache-report.mdo b/maven-core/src/main/mdo/cache-report.mdo
new file mode 100644
index 0000000..d081946
--- /dev/null
+++ b/maven-core/src/main/mdo/cache-report.mdo
@@ -0,0 +1,108 @@
+<!--
+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.
+-->
+
+<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">
+ <id>cache-report</id>
+ <name>CacheReport</name>
+ <description><![CDATA[
+ ]]></description>
+ <defaults>
+ <default>
+ <key>package</key>
+ <value>org.apache.maven.caching.domain</value>
+ </default>
+ </defaults>
+ <classes>
+
+ <class rootElement="true">
+ <name>CacheReportType</name>
+ <fields>
+ <field>
+ <name>project</name>
+ <association>
+ <type>ProjectReportType</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ </fields>
+ </class>
+
+ <!--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-->
+
+ <class>
+ <name>ProjectReportType</name>
+ <fields>
+ <field>
+ <name>groupId</name>
+ <type>String</type>
+ </field>
+ <field>
+ <name>artifactId</name>
+ <type>String</type>
+ </field>
+ <field>
+ <name>checksum</name>
+ <type>String</type>
+ </field>
+ <field>
+ <name>checksumMatched</name>
+ <type>Boolean</type>
+ </field>
+ <field>
+ <name>lifecycleMatched</name>
+ <type>Boolean</type>
+ </field>
+ <field>
+ <name>pluginsMatched</name>
+ <type>Boolean</type>
+ </field>
+ <field>
+ <name>source</name>
+ <type>String</type>
+ </field>
+ <field>
+ <name>sharedToRemote</name>
+ <type>Boolean</type>
+ </field>
+ <field>
+ <name>url</name>
+ <type>String</type>
+ </field>
+ </fields>
+ </class>
+
+ </classes>
+</model>
diff --git a/maven-core/src/test/java/org/apache/maven/caching/BuildInfoTest.java b/maven-core/src/test/java/org/apache/maven/caching/BuildInfoTest.java
index 6c9b14c..19c1de4 100644
--- a/maven-core/src/test/java/org/apache/maven/caching/BuildInfoTest.java
+++ b/maven-core/src/test/java/org/apache/maven/caching/BuildInfoTest.java
@@ -25,29 +25,29 @@ import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DefaultArtifact;
import org.apache.maven.artifact.handler.DefaultArtifactHandler;
import org.apache.maven.caching.hash.HashFactory;
-import org.apache.maven.caching.jaxb.ArtifactType;
-import org.apache.maven.caching.jaxb.BuildInfoType;
-import org.apache.maven.caching.jaxb.CompletedExecutionType;
-import org.apache.maven.caching.jaxb.DigestItemType;
-import org.apache.maven.caching.jaxb.ProjectsInputInfoType;
-import org.apache.maven.caching.jaxb.PropertyValueType;
+import org.apache.maven.caching.domain.ArtifactType;
+import org.apache.maven.caching.domain.BuildInfoType;
+import org.apache.maven.caching.domain.CompletedExecutionType;
+import org.apache.maven.caching.domain.DigestItemType;
+import org.apache.maven.caching.domain.ProjectsInputInfoType;
+import org.apache.maven.caching.domain.PropertyValueType;
import org.apache.maven.caching.xml.BuildInfo;
import org.apache.maven.caching.xml.XmlService;
+import org.junit.Test;
-import javax.xml.datatype.DatatypeFactory;
import java.io.File;
-import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.util.GregorianCalendar;
-
-import static org.apache.maven.caching.xml.BuildInfo.createGoals;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
public class BuildInfoTest {
- // @Test
+ @Test
public void name() throws Exception {
XmlService xmlService = new XmlService();
@@ -64,16 +64,16 @@ public class BuildInfoTest {
artifact.setClassifier("c");
artifact.setScope("s");
artifact.setFileName("f");
- artifact.setFileSize(BigInteger.valueOf(123456));
+ artifact.setFileSize(123456);
artifact.setFileHash("456L");
BuildInfoType buildInfo = new BuildInfoType();
buildInfo.setCacheImplementationVersion("cacheImplementationVersion");
buildInfo.setBuildServer("server");
- buildInfo.setBuildTime(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()));
+ buildInfo.setBuildTime(new Date());
buildInfo.setArtifact(artifact);
buildInfo.setHashFunction("SHA-256");
- buildInfo.setGoals(createGoals(Lists.newArrayList("install")));
+ buildInfo.setGoals(Lists.newArrayList("install"));
final Artifact attachedArtifact = new DefaultArtifact("ag", "aa", "av", "as", "at", "ac", new DefaultArtifactHandler());
buildInfo.setAttachedArtifacts(BuildInfo.createAttachedArtifacts(Lists.newArrayList(attachedArtifact), HashFactory.XX.createAlgorithm()));
buildInfo.setProjectsInputInfo(main);
@@ -90,17 +90,14 @@ public class BuildInfoTest {
System.out.println(buildInfo1);
}
- private BuildInfoType.Executions createExecutions() {
+ private List<CompletedExecutionType> createExecutions() {
CompletedExecutionType execution = new CompletedExecutionType();
execution.setExecutionKey("execkey");
- execution.setConfiguration(new CompletedExecutionType.Configuration());
PropertyValueType property = new PropertyValueType();
property.setValue("value");
property.setName("key");
- execution.getConfiguration().getProperty().add(property);
- BuildInfoType.Executions executions = new BuildInfoType.Executions();
- executions.getExecution().add(execution);
- return executions;
+ execution.setConfiguration(new ArrayList<>(Arrays.asList(property)));
+ return new ArrayList<>(Arrays.asList(execution));
}
private DigestItemType createItem(String pom, String s, String hash1) {