diff options
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 ); } } @@ -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> |