fix xbib upload

This commit is contained in:
Jörg Prante 2019-05-08 11:31:06 +02:00
parent 793cda09b1
commit 098fc46687
4 changed files with 6 additions and 31 deletions

View file

@ -35,17 +35,15 @@ subprojects {
configurations { configurations {
asciidoclet asciidoclet
wagon
} }
dependencies { dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api:${project.property('junit.version')}" testImplementation "org.junit.jupiter:junit-jupiter-api:${project.property('junit.version')}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${project.property('junit.version')}"
testImplementation "org.apache.logging.log4j:log4j-core:${project.property('log4j.version')}" testImplementation "org.apache.logging.log4j:log4j-core:${project.property('log4j.version')}"
testImplementation "org.apache.logging.log4j:log4j-jul:${project.property('log4j.version')}" testImplementation "org.apache.logging.log4j:log4j-jul:${project.property('log4j.version')}"
testImplementation "org.apache.logging.log4j:log4j-slf4j-impl:${project.property('log4j.version')}" testImplementation "org.apache.logging.log4j:log4j-slf4j-impl:${project.property('log4j.version')}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${project.property('junit.version')}"
asciidoclet "org.xbib:asciidoclet:${project.property('asciidoclet.version')}" asciidoclet "org.xbib:asciidoclet:${project.property('asciidoclet.version')}"
wagon "org.apache.maven.wagon:wagon-ssh:${project.property('wagon.version')}"
} }
compileJava { compileJava {

View file

@ -49,13 +49,6 @@ public abstract class HttpAction<R extends ActionRequest, T extends ActionRespon
public abstract GenericAction<R, T> getActionInstance(); public abstract GenericAction<R, T> getActionInstance();
/*public final ActionFuture<T> execute(HttpActionContext<R, T> httpActionContext) {
PlainActionFuture<T> future = PlainActionFuture.newFuture();
//HttpActionFuture<T, T> future = new HttpActionFuture<>();
execute(httpActionContext, future);
return future;
}*/
final void execute(HttpActionContext<R, T> httpActionContext, ActionListener<T> listener) throws IOException { final void execute(HttpActionContext<R, T> httpActionContext, ActionListener<T> listener) throws IOException {
try { try {
ActionRequestValidationException validationException = httpActionContext.getRequest().validate(); ActionRequestValidationException validationException = httpActionContext.getRequest().validate();
@ -66,11 +59,12 @@ public abstract class HttpAction<R extends ActionRequest, T extends ActionRespon
RequestBuilder httpRequestBuilder = RequestBuilder httpRequestBuilder =
createHttpRequest(httpActionContext.getUrl(), httpActionContext.getRequest()); createHttpRequest(httpActionContext.getUrl(), httpActionContext.getRequest());
Request httpRequest = httpRequestBuilder.build(); Request httpRequest = httpRequestBuilder.build();
logger.log(Level.DEBUG, "action = {} request = {}", this.getClass().getName(), httpRequest.toString());
httpRequest.setResponseListener(fullHttpResponse -> { httpRequest.setResponseListener(fullHttpResponse -> {
if (logger.isDebugEnabled()) {
logger.log(Level.DEBUG, "got response: " + fullHttpResponse.status().code() + logger.log(Level.DEBUG, "got response: " + fullHttpResponse.status().code() +
" headers = " + fullHttpResponse.headers().entries() + " headers = " + fullHttpResponse.headers().entries() +
" content = " + fullHttpResponse.content().toString(StandardCharsets.UTF_8)); " content = " + fullHttpResponse.content().toString(StandardCharsets.UTF_8));
}
httpActionContext.setHttpResponse(fullHttpResponse); httpActionContext.setHttpResponse(fullHttpResponse);
if (fullHttpResponse.status().equals(HttpResponseStatus.OK)) { if (fullHttpResponse.status().equals(HttpResponseStatus.OK)) {
listener.onResponse(parseToResponse(httpActionContext)); listener.onResponse(parseToResponse(httpActionContext));

View file

@ -11,7 +11,6 @@ xbib-netty-http.version = 4.1.35.0
# test # test
junit.version = 5.4.2 junit.version = 5.4.2
wagon.version = 3.3.2
asciidoclet.version = 1.6.0.0 asciidoclet.version = 1.6.0.0
org.gradle.warning.mode = all org.gradle.warning.mode = all

View file

@ -5,22 +5,6 @@ ext {
scmDeveloperConnection = 'scm:git:git://github.com/jprante/elx.git' scmDeveloperConnection = 'scm:git:git://github.com/jprante/elx.git'
} }
task xbibUpload(type: Upload, dependsOn: build) {
group = 'publish'
configuration = configurations.archives
uploadDescriptor = true
repositories {
if (project.hasProperty("xbibUsername")) {
mavenDeployer {
configuration = configurations.wagon
repository(url: uri(project.property('xbibUrl'))) {
authentication(userName: xbibUsername, privateKey: xbibPrivateKey)
}
}
}
}
}
task sonaTypeUpload(type: Upload, dependsOn: build) { task sonaTypeUpload(type: Upload, dependsOn: build) {
group = 'publish' group = 'publish'
configuration = configurations.archives configuration = configurations.archives