diff options
author | Olivier Lamy <olamy@apache.org> | 2014-01-07 09:28:05 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2014-01-07 09:28:05 +0000 |
commit | 2d840d9ffe0ebfe949a09638ebf0d81f4a2c8f21 (patch) | |
tree | 31a537256bc0d02882bbc8bd5a924dfbc8981d9c /archiva-modules/plugins | |
parent | 59743128e85e9f81fc214ab87531bfc3e3d5e603 (diff) | |
download | archiva-2d840d9ffe0ebfe949a09638ebf0d81f4a2c8f21.tar.gz archiva-2d840d9ffe0ebfe949a09638ebf0d81f4a2c8f21.zip |
use strict matching for model mapper
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1556158 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/plugins')
2 files changed, 11 insertions, 2 deletions
diff --git a/archiva-modules/plugins/maven2-repository/pom.xml b/archiva-modules/plugins/maven2-repository/pom.xml index 0d04e7ae9..b321f1dbb 100644 --- a/archiva-modules/plugins/maven2-repository/pom.xml +++ b/archiva-modules/plugins/maven2-repository/pom.xml @@ -263,6 +263,9 @@ org.sonatype.aether.util, org.sonatype.aether.util.artifact, org.modelmapper, + org.modelmapper.config, + org.modelmapper.convention, + org.modelmapper.spi, org.apache.archiva.maven2.model, org.sonatype.aether.util.graph.selector, org.apache.archiva.metadata.model.maven2, diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/TreeDependencyNodeVisitor.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/TreeDependencyNodeVisitor.java index 82c8aa873..56ab172d3 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/TreeDependencyNodeVisitor.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/TreeDependencyNodeVisitor.java @@ -21,6 +21,7 @@ package org.apache.archiva.dependency.tree.maven2; import org.apache.archiva.maven2.model.Artifact; import org.apache.archiva.maven2.model.TreeEntry; import org.modelmapper.ModelMapper; +import org.modelmapper.convention.MatchingStrategies; import org.sonatype.aether.graph.DependencyNode; import org.sonatype.aether.graph.DependencyVisitor; @@ -48,8 +49,8 @@ public class TreeDependencyNodeVisitor public boolean visitEnter( DependencyNode dependencyNode ) { - TreeEntry entry = new TreeEntry( - getModelMapper().map( dependencyNode.getDependency().getArtifact(), Artifact.class ) ); + TreeEntry entry = + new TreeEntry( getModelMapper().map( dependencyNode.getDependency().getArtifact(), Artifact.class ) ); entry.getArtifact().setScope( dependencyNode.getDependency().getScope() ); entry.setParent( currentEntry ); currentEntry = entry; @@ -75,6 +76,11 @@ public class TreeDependencyNodeVisitor private static class ModelMapperHolder { private static ModelMapper MODEL_MAPPER = new ModelMapper(); + + static + { + MODEL_MAPPER.getConfiguration().setMatchingStrategy( MatchingStrategies.STRICT ); + } } protected ModelMapper getModelMapper() |