diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml index 5a62d7ea6..cff05468d 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml @@ -31,8 +31,6 @@ ${project.build.outputDirectory}/rest-docs-archiva-rest-api ${project.parent.parent.parent.basedir} - 2.1.2 - 2.1.2 @@ -79,46 +77,6 @@ javax.ws.rs javax.ws.rs-api - - io.swagger.core.v3 - swagger-core - compile - ${io.swagger.version} - - - javax.ws.rs - jsr311-api - - - - - io.swagger.core.v3 - swagger-jaxrs2 - ${io.swagger.version} - - - javax.ws.rs - jsr311-api - - - - - io.swagger.core.v3 - swagger-annotations - ${io.swagger.version} - - - javax.ws.rs - jsr311-api - - - - - jakarta.xml.bind - jakarta.xml.bind-api - - - @@ -135,95 +93,6 @@ - - org.apache.maven.plugins - maven-source-plugin - - - bind-sources - - jar-no-fork - - - - - - io.swagger.core.v3 - swagger-maven-plugin - ${swagger-maven-plugin-version} - - openapi - ${project.build.directory}/generated - JSONANDYAML - - org.apache.archiva.rest.api - - TRUE - ${project.basedir}/src/main/resources/openapi-configuration.yaml - - - - compile - - resolve - - - - - - - io.swagger.codegen.v3 - swagger-codegen-maven-plugin - 3.0.20 - - - compile - - generate - - - ${project.build.directory}/generated/openapi.yaml - html - ${project.build.directory}/generated-sources - ${project.basedir}/src/main/resources/openapi-codegen-ignore - ${project.basedir}/src/main/resources/templates - index.html,index2.html - - - - - - - maven-resources-plugin - 3.1.0 - - - copy-resources - site - - copy-resources - - - ${basedir}/target/site/openapi/ - - - ${project.build.directory}/generated - false - openapi.json - openapi.yaml - - - ${project.build.directory}/generated-sources/ - false - **/* - .swagger-codegen/** - .swagger-codegen-ignore - - - - - - diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ActionStatus.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ActionStatus.java index 5620f4f35..b4534b9a7 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ActionStatus.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ActionStatus.java @@ -18,7 +18,6 @@ package org.apache.archiva.rest.api.model; * under the License. */ -import javax.swing.*; import javax.xml.bind.annotation.XmlRootElement; /** @@ -32,6 +31,9 @@ public class ActionStatus public static final ActionStatus SUCCESS = new ActionStatus( true ); public static final ActionStatus FAIL = new ActionStatus( false ); + public static ActionStatus FROM(boolean status) { + return status ? SUCCESS : FAIL; + } public ActionStatus() { @@ -51,5 +53,9 @@ public class ActionStatus this.success = success; } - + @Override + public String toString( ) + { + return Boolean.toString( success ); + } } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml index d8fed9482..6e9f62600 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml @@ -439,6 +439,12 @@ provided + + javax.validation + validation-api + provided + + diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/interceptors/JacksonJsonConfigurator.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/interceptors/JacksonJsonConfigurator.java index 4137eb74f..aaca91779 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/interceptors/JacksonJsonConfigurator.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/interceptors/JacksonJsonConfigurator.java @@ -21,11 +21,13 @@ package org.apache.archiva.rest.services.interceptors; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.dataformat.xml.XmlMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import javax.inject.Inject; +import javax.inject.Named; /** * class to setup Jackson Json configuration @@ -39,9 +41,12 @@ public class JacksonJsonConfigurator private Logger log = LoggerFactory.getLogger( getClass() ); @Inject - public JacksonJsonConfigurator( ObjectMapper objectMapper ) + public JacksonJsonConfigurator( @Named( "redbackJacksonJsonMapper" ) ObjectMapper objectMapper, + @Named( "redbackJacksonXMLMapper" ) XmlMapper xmlMapper ) { + log.info( "configure jackson ObjectMapper" ); - objectMapper.configure( DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false ); + objectMapper.disable( DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + xmlMapper.disable( DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES ); } } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/spring-context.xml index ede2fe6c0..a7ace5160 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/spring-context.xml @@ -39,17 +39,23 @@ - - - + + + + + + + + + - - + + @@ -78,12 +84,6 @@ - - - - - - diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java index acd74d0e3..436ea5d96 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java @@ -168,7 +168,7 @@ public class DownloadArtifactsTest RoleManagementService roleManagementService = getRoleManagementService( authorizationHeader ); if ( !roleManagementService.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, - "internal" ) ) + "internal" ).isExists() ) { roleManagementService.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, "internal" ); } diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadSnapshotTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadSnapshotTest.java index 05a29966c..07c2a7101 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadSnapshotTest.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadSnapshotTest.java @@ -131,7 +131,7 @@ public class DownloadSnapshotTest RoleManagementService roleManagementService = getRoleManagementService( authorizationHeader ); if ( !roleManagementService.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, - id ) ) + id ).isExists() ) { roleManagementService.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, id ); } diff --git a/pom.xml b/pom.xml index ca0cbfdf4..1188a71d5 100644 --- a/pom.xml +++ b/pom.xml @@ -165,6 +165,12 @@ javax.ws.rs-api ${javax.jaxrs.version} + + javax.validation + validation-api + ${javax.validation.version} + provided + @@ -1632,6 +1638,43 @@ ${cxf.version} + + io.swagger.core.v3 + swagger-core + compile + ${io.swagger.version} + + + javax.ws.rs + jsr311-api + + + + + io.swagger.core.v3 + swagger-jaxrs2 + ${io.swagger.version} + + + javax.ws.rs + jsr311-api + + + + + io.swagger.core.v3 + swagger-annotations + ${io.swagger.version} + + + javax.ws.rs + jsr311-api + + + + + +