Skip to content

Commit

Permalink
Merge pull request #17 from matejsp/master
Browse files Browse the repository at this point in the history
Fixes for nexus 3.29
  • Loading branch information
chenlingmin authored Jan 21, 2021
2 parents 0215b9a + 7a3def6 commit d4e3c47
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'com.nongfenqi.nexus.plugin'
version '1.0.1'
version '1.0.3'


apply plugin: 'java'
Expand All @@ -24,9 +24,9 @@ repositories {

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compileOnly group: 'org.sonatype.nexus', name: 'nexus-plugin-api', version: '3.20.1-01'
compileOnly group: 'org.sonatype.nexus', name: 'nexus-repository', version: '3.20.1-01'
compileOnly group: 'org.sonatype.nexus', name: 'nexus-rest', version: '3.20.1-01'
compileOnly group: 'org.sonatype.nexus', name: 'nexus-plugin-api', version: '3.29.2-02'
compileOnly group: 'org.sonatype.nexus', name: 'nexus-repository', version: '3.29.2-02'
compileOnly group: 'org.sonatype.nexus', name: 'nexus-rest', version: '3.29.2-02'
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.16.18'
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 黑牛
* Copyright 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
Expand All @@ -17,7 +17,6 @@
*/
package com.nongfenqi.nexus.plugin.rundeck;

import com.google.common.base.Supplier;
import org.apache.http.client.utils.DateUtils;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.index.query.BoolQueryBuilder;
Expand All @@ -38,9 +37,19 @@
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.*;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;
import java.util.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Supplier;
import java.util.stream.Collectors;

import static com.google.common.base.Preconditions.checkNotNull;
Expand Down Expand Up @@ -114,11 +123,13 @@ public Response content(
return commitAndReturn(NOT_FOUND, tx);
}

String folderVersion = version.replaceAll("-\\d{8}\\.\\d{6}\\-\\d+", "-SNAPSHOT");
String fileName = artifactId + "-" + version + (isBlank(classifier) ? "" : ("-" + classifier)) + "." + extension;
String path = groupId.replace(".", "/") +
"/" + artifactId +
"/" + version +
"/" + folderVersion +
"/" + fileName;

Asset asset = tx.findAssetWithProperty("name", path, bucket);
log.debug("rundeck download asset: {}", asset);
if (null == asset) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 黑牛
* Copyright 2017
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
Expand Down

0 comments on commit d4e3c47

Please sign in to comment.