Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last bug correction for artifactId search #23

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ gradle-app.setting
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
.idea

nexus-data/
.project
.settings/
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM openjdk:8 as builder
#FROM openjdk:8 as builder

COPY . .
RUN ./gradlew jar
#COPY . .
#RUN ./gradlew jar

#FROM sonatype/nexus3:3.49.0
FROM klo2k/nexus3
FROM sonatype/nexus3:3.60.0
#FROM klo2k/nexus3
#docker build . -t nex --platform linux/arm64/v8
#export DOCKER_DEFAULT_PLATFORM=linux/arm64/v8
#docker run -v $PWD/nexus-data:/nexus-data -p 8081:8081 nex
#Nexus 3 version to use
ARG NEXUS_VERSION=3.49.0
ARG RUNDECK_PLUGIN_VERSION=1.1.0
ARG RUNDECK_PLUGIN_VERSION=1.1.3

USER root

Expand All @@ -21,7 +21,7 @@ USER root
RUN mkdir -p system/com/nongfenqi/nexus/plugin/${RUNDECK_PLUGIN_VERSION}


COPY --from=builder build/libs/nexus3-rundeck-plugin-${RUNDECK_PLUGIN_VERSION}.jar \
COPY build/libs/nexus3-rundeck-plugin-${RUNDECK_PLUGIN_VERSION}.jar \
$NEXUS_HOME/system/com/nongfenqi/nexus/plugin/${RUNDECK_PLUGIN_VERSION}/nexus3-rundeck-plugin-${RUNDECK_PLUGIN_VERSION}.jar


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The plugin provides the following new HTTP resources :
- `v` : versions of the artifacts to match
- `p` : packaging of the artifacts to match ('jar', 'war', etc)
- `c` : classifier of the artifacts to match ('sources', 'javadoc', etc)
- `l` : limit - max number of results to return, default value is 50
- `l` : limit - max number of results to return, default value is 10000

- `http://NEXUS_HOST/service/rest/rundeck/maven/options/version` : return a json array with the version of the matching artifacts.
Parameters (all optional) :
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'com.nongfenqi.nexus.plugin'
version '1.1.1'
version '1.1.3'


apply plugin: 'java'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public Response content(
@Path("artifactId")
@Produces(APPLICATION_JSON)
public List<String> artifactId(
@DefaultValue("50") @QueryParam("l") int limit,
@DefaultValue("10000") @QueryParam("l") int limit,
@QueryParam("r") String repository,
@QueryParam("g") String groupId,
@QueryParam("v") String version,
Expand Down Expand Up @@ -178,7 +178,7 @@ public List<String> artifactId(

SearchResponse result = searchService.search(searchRequest);
return result.getSearchResults().stream()
.map(this::searchResults2RundeckXOArtifact)
.map(this::searchResults2RundeckXOArtifact).distinct()
.collect(Collectors.toList());
}

Expand Down Expand Up @@ -218,7 +218,7 @@ public List<RundeckXO> version(

searchRequestBuilder.offset(0)
.limit(limit)
.sortField("assets.attributes.content.last_modified")
.sortField("assets.attributes.maven2.version")
.sortDirection(SortDirection.DESC);

SearchRequest searchRequest = searchRequestBuilder.build();
Expand Down