summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-repository-admin
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2014-01-07 08:55:08 +0000
committerOlivier Lamy <olamy@apache.org>2014-01-07 08:55:08 +0000
commit59743128e85e9f81fc214ab87531bfc3e3d5e603 (patch)
treee9aaf09abf2d3df9889c9c45e00f60ba24ccdd6c /archiva-modules/archiva-base/archiva-repository-admin
parente1e6140d1696056bd6128eb1e881fe633fc81626 (diff)
downloadarchiva-59743128e85e9f81fc214ab87531bfc3e3d5e603.tar.gz
archiva-59743128e85e9f81fc214ab87531bfc3e3d5e603.zip
use strict matching for model mapper
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1556150 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-repository-admin')
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml3
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java12
2 files changed, 12 insertions, 3 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
index 10beac182..5042d5708 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
@@ -261,6 +261,9 @@
org.springframework*;version="[3,4)",
org.apache.maven.index*,
org.apache.maven.wagon*,
+ org.modelmapper.config,
+ org.modelmapper.convention,
+ org.modelmapper.spi,
org.apache.archiva.redback.role,
org.apache.archiva.redback.users,
org.apache.archiva.redback.components.registry,
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java
index 194028f29..ab771b398 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java
@@ -29,6 +29,7 @@ import org.apache.archiva.configuration.IndeterminateConfigurationException;
import org.apache.archiva.redback.users.User;
import org.apache.archiva.redback.components.registry.Registry;
import org.modelmapper.ModelMapper;
+import org.modelmapper.convention.MatchingStrategies;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -56,15 +57,14 @@ public abstract class AbstractRepositoryAdmin
private ArchivaConfiguration archivaConfiguration;
@Inject
- @Named( value = "commons-configuration" )
+ @Named(value = "commons-configuration")
private Registry registry;
protected void triggerAuditEvent( String repositoryId, String resource, String action,
AuditInformation auditInformation )
{
User user = auditInformation == null ? null : auditInformation.getUser();
- AuditEvent event =
- new AuditEvent( repositoryId, user == null ? "null" : user.getUsername(), resource, action );
+ AuditEvent event = new AuditEvent( repositoryId, user == null ? "null" : user.getUsername(), resource, action );
event.setRemoteIP( auditInformation == null ? "null" : auditInformation.getRemoteAddr() );
for ( AuditListener listener : getAuditListeners() )
@@ -95,6 +95,12 @@ public abstract class AbstractRepositoryAdmin
private static class ModelMapperHolder
{
private static ModelMapper MODEL_MAPPER = new ModelMapper();
+
+ static
+ {
+ MODEL_MAPPER.getConfiguration().setMatchingStrategy( MatchingStrategies.STRICT );
+ }
+
}
protected ModelMapper getModelMapper()