summaryrefslogtreecommitdiffstats
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
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
-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
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java2
-rw-r--r--pom.xml6
4 files changed, 17 insertions, 6 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()
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java
index 8e1b8a812..c586e3844 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java
@@ -49,6 +49,7 @@ import org.apache.archiva.security.UserRepositories;
import org.apache.commons.lang.StringUtils;
import org.modelmapper.ModelMapper;
import org.modelmapper.PropertyMap;
+import org.modelmapper.convention.MatchingStrategies;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
@@ -323,6 +324,7 @@ public abstract class AbstractRestService
static
{
MODEL_MAPPER.addMappings( new SearchResultHitMap() );
+ MODEL_MAPPER.getConfiguration().setMatchingStrategy( MatchingStrategies.STRICT );
}
}
diff --git a/pom.xml b/pom.xml
index ac8d2499b..15f58fb83 100644
--- a/pom.xml
+++ b/pom.xml
@@ -70,9 +70,9 @@
<redback.version>2.2-SNAPSHOT</redback.version>
<redback.cache.version>2.2-SNAPSHOT</redback.cache.version>
<redback.quartz.version>2.1-SNAPSHOT</redback.quartz.version>
- <redback.registry.version>2.1</redback.registry.version>
- <redback.spring-utils.version>2.0</redback.spring-utils.version>
- <redback.taskqueue.version>2.0</redback.taskqueue.version>
+ <redback.registry.version>2.2-SNAPSHOT</redback.registry.version>
+ <redback.spring-utils.version>2.1-SNAPSHOT</redback.spring-utils.version>
+ <redback.taskqueue.version>2.1-SNAPSHOT</redback.taskqueue.version>
<slf4j.version>1.7.5</slf4j.version>
<log4j.version>2.0-beta9</log4j.version>