Skip to content

Commit cd0ef72

Browse files
committed
[jgitflow-maven-plugin] merging 'release/1.1.0' into 'master'
2 parents 828af3c + a9e92d9 commit cd0ef72

File tree

12 files changed

+351
-131
lines changed

12 files changed

+351
-131
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<img src="http://wcm.io/images/[email protected]"/> Maven NodeJS Proxy
22
======
33
[![Build Status](https://travis-ci.org/wcm-io-devops/maven-nodejs-proxy.png?branch=develop)](https://travis-ci.org/wcm-io-devops/maven-nodejs-proxy)
4+
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.wcm.devops.maven/io.wcm.devops.maven.nodejs-proxy/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.wcm.devops.maven/io.wcm.devops.maven.nodejs-proxy)
45

56
Maven proxy to download NodeJS binaries as Maven artifacts.
67

changes.xml

+10
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd">
2424
<body>
2525

26+
<release version="1.1.0" date="2016-03-22">
27+
<action type="update" dev="sseifert" issue="WDEVOP-1">
28+
Binary File Structre changed in NPM Versions > 0.x and support for SHA-256 checksums.
29+
Please update your configuration file, some parameters needed to be changed.
30+
</action>
31+
<action type="update" dev="sseifert">
32+
Update to dropwizard 0.9.2.
33+
</action>
34+
</release>
35+
2636
<release version="1.0.0" date="2015-09-03">
2737
<action type="add" dev="sseifert">
2838
Initial release.

maven-nodejs-proxy/config.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This is a Dropwizard-based Microservice
2+
# See https://dropwizard.github.io/dropwizard/manual/configuration.html
3+
14
# Group Id to publish artifacts to
25
groupId: org.nodejs.dist
36

@@ -12,12 +15,17 @@ nodeJsBinariesRootUrl: "https://nodejs.org/dist"
1215

1316
# Url parts to download the different artifacts
1417
nodeJsBinariesUrl: "/v${version}/node-v${version}-${os}-${arch}.${type}"
15-
nodeJsBinariesUrlWindows: "/v${version}/${arch}/node.${type}"
16-
nodeJsBinariesUrlWindowsX86: "/v${version}/node.${type}"
18+
nodeJsBinariesUrlWindows: "/v${version}/win-${arch}/node.${type}"
19+
nodeJsBinariesUrlWindowsX86Legacy: "/v${version}/node.${type}"
20+
nodeJsBinariesUrlWindowsX64Legacy: "/v${version}/${arch}/node.${type}"
1721
npmBinariesUrl: "/npm/npm-${version}.${type}"
1822

19-
# SHA-1 checksums file
20-
nodeJsChecksumUrl: "/v${version}/SHASUMS.txt"
23+
# SHA-256 checksums file
24+
nodeJsChecksumUrl: "/v${version}/SHASUMS256.txt"
25+
26+
# Sample versions for index page
27+
nodeJsSampleVersion: 4.4.0
28+
npmSampleVersion: 1.4.9
2129

2230
# HTTP Client settings
2331
httpClient:

maven-nodejs-proxy/pom.xml

+26-4
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@
2525
<parent>
2626
<groupId>io.wcm.devops</groupId>
2727
<artifactId>io.wcm.devops.parent_toplevel</artifactId>
28-
<version>1.0.0</version>
28+
<version>1.0.2</version>
2929
<relativePath />
3030
</parent>
3131

3232
<groupId>io.wcm.devops.maven</groupId>
3333
<artifactId>io.wcm.devops.maven.nodejs-proxy</artifactId>
34-
<version>1.0.0</version>
34+
<version>1.1.0</version>
3535
<packaging>jar</packaging>
3636

3737
<name>Maven NodeJS Proxy</name>
3838
<description>Maven proxy to download NodeJS binaries as Maven artifacts.</description>
3939

4040
<properties>
41-
<dropwizard.version>0.9.0-rc4</dropwizard.version>
41+
<dropwizard.version>0.9.2</dropwizard.version>
4242
</properties>
4343

4444
<dependencies>
@@ -55,6 +55,12 @@
5555
<version>${dropwizard.version}</version>
5656
<scope>compile</scope>
5757
</dependency>
58+
<dependency>
59+
<groupId>io.dropwizard</groupId>
60+
<artifactId>dropwizard-testing</artifactId>
61+
<version>${dropwizard.version}</version>
62+
<scope>test</scope>
63+
</dependency>
5864

5965
<dependency>
6066
<groupId>commons-io</groupId>
@@ -70,6 +76,13 @@
7076
<scope>compile</scope>
7177
</dependency>
7278

79+
<dependency>
80+
<groupId>org.apache.maven</groupId>
81+
<artifactId>maven-artifact</artifactId>
82+
<version>3.3.9</version>
83+
<scope>compile</scope>
84+
</dependency>
85+
7386
</dependencies>
7487

7588
<build>
@@ -78,7 +91,6 @@
7891
<plugin>
7992
<groupId>org.apache.maven.plugins</groupId>
8093
<artifactId>maven-shade-plugin</artifactId>
81-
<version>2.3</version>
8294
<configuration>
8395
<createDependencyReducedPom>true</createDependencyReducedPom>
8496
<filters>
@@ -122,6 +134,16 @@
122134
</configuration>
123135
</plugin>
124136

137+
<!-- Disable parallel Unit tests -->
138+
<plugin>
139+
<groupId>org.apache.maven.plugins</groupId>
140+
<artifactId>maven-surefire-plugin</artifactId>
141+
<configuration>
142+
<parallel>none</parallel>
143+
<threadCount>0</threadCount>
144+
</configuration>
145+
</plugin>
146+
125147
</plugins>
126148
</build>
127149

maven-nodejs-proxy/src/main/java/io/wcm/devops/maven/nodejsproxy/MavenProxyConfiguration.java

+27-6
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919
*/
2020
package io.wcm.devops.maven.nodejsproxy;
2121

22-
import io.dropwizard.Configuration;
23-
import io.dropwizard.client.HttpClientConfiguration;
24-
2522
import javax.validation.Valid;
2623
import javax.validation.constraints.NotNull;
2724

2825
import org.hibernate.validator.constraints.NotEmpty;
2926

3027
import com.fasterxml.jackson.annotation.JsonProperty;
3128

29+
import io.dropwizard.Configuration;
30+
import io.dropwizard.client.HttpClientConfiguration;
31+
3232
/**
3333
* Configuration for Maven NodeJS Proxy.
3434
*/
@@ -47,11 +47,17 @@ public class MavenProxyConfiguration extends Configuration {
4747
@NotEmpty
4848
private String nodeJsBinariesUrlWindows;
4949
@NotEmpty
50-
private String nodeJsBinariesUrlWindowsX86;
50+
private String nodeJsBinariesUrlWindowsX86Legacy;
51+
@NotEmpty
52+
private String nodeJsBinariesUrlWindowsX64Legacy;
5153
@NotEmpty
5254
private String npmBinariesUrl;
5355
@NotEmpty
5456
private String nodeJsChecksumUrl;
57+
@NotEmpty
58+
private String nodeJsSampleVersion;
59+
@NotEmpty
60+
private String npmSampleVersion;
5561

5662
@Valid
5763
@NotNull
@@ -88,8 +94,13 @@ public String getNodeJsBinariesUrlWindows() {
8894
}
8995

9096
@JsonProperty
91-
public String getNodeJsBinariesUrlWindowsX86() {
92-
return this.nodeJsBinariesUrlWindowsX86;
97+
public String getNodeJsBinariesUrlWindowsX86Legacy() {
98+
return this.nodeJsBinariesUrlWindowsX86Legacy;
99+
}
100+
101+
@JsonProperty
102+
public String getNodeJsBinariesUrlWindowsX64Legacy() {
103+
return this.nodeJsBinariesUrlWindowsX64Legacy;
93104
}
94105

95106
@JsonProperty
@@ -102,6 +113,16 @@ public String getNodeJsChecksumUrl() {
102113
return this.nodeJsChecksumUrl;
103114
}
104115

116+
@JsonProperty
117+
public String getNodeJsSampleVersion() {
118+
return this.nodeJsSampleVersion;
119+
}
120+
121+
@JsonProperty
122+
public String getNpmSampleVersion() {
123+
return this.npmSampleVersion;
124+
}
125+
105126
@JsonProperty("httpClient")
106127
public HttpClientConfiguration getHttpClient() {
107128
return httpClient;

maven-nodejs-proxy/src/main/java/io/wcm/devops/maven/nodejsproxy/resource/Checksums.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ public class Checksums {
3434
private final Map<String, String> checksums = new HashMap<>();
3535

3636
private static final Pattern LEVEL_1_RELATIVE_NAME = Pattern.compile("^.*/([^/]+)$");
37-
private static final Pattern LEVEL_2_RELATIVE_NAME = Pattern.compile("^.*/([^/]+/[^/]+)$");;
37+
private static final Pattern LEVEL_2_RELATIVE_NAME = Pattern.compile("^.*/([^/]+/[^/]+)$");
3838

3939
/**
4040
* @param data Checksums file content
4141
*/
4242
public Checksums(String data) {
4343
String[] lines = StringUtils.split(data, "\n");
4444
for (String line : lines) {
45-
String sha1 = StringUtils.substringBefore(line, " ");
45+
String checksum = StringUtils.substringBefore(line, " ");
4646
String filename = StringUtils.substringAfter(line, " ");
47-
if (StringUtils.isNoneBlank(sha1, filename)) {
48-
checksums.put(filename, sha1);
47+
if (StringUtils.isNoneBlank(checksum, filename)) {
48+
checksums.put(filename, checksum);
4949
}
5050
}
5151
}

maven-nodejs-proxy/src/main/java/io/wcm/devops/maven/nodejsproxy/resource/IndexPageBuilder.java

+18-14
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,24 @@
1919
*/
2020
package io.wcm.devops.maven.nodejsproxy.resource;
2121

22-
import io.wcm.devops.maven.nodejsproxy.MavenProxyConfiguration;
23-
2422
import org.apache.commons.lang3.StringUtils;
2523

24+
import io.wcm.devops.maven.nodejsproxy.MavenProxyConfiguration;
25+
2626
/**
2727
* Builds HTML index page
2828
*/
2929
public final class IndexPageBuilder {
3030

3131
private static final String[] EXAMPLE_URLS = new String[] {
32-
"${groupIdPath}/${nodeJsArtifactId}/0.12.0/${nodeJsArtifactId}-0.12.0.pom",
33-
"${groupIdPath}/${nodeJsArtifactId}/0.12.0/${nodeJsArtifactId}-0.12.0-windows-x86.exe",
34-
"${groupIdPath}/${nodeJsArtifactId}/0.12.0/${nodeJsArtifactId}-0.12.0-windows-x64.exe",
35-
"${groupIdPath}/${nodeJsArtifactId}/0.12.0/${nodeJsArtifactId}-0.12.0-linux-x86.tar.gz",
36-
"${groupIdPath}/${nodeJsArtifactId}/0.12.0/${nodeJsArtifactId}-0.12.0-linux-x64.tar.gz",
37-
"${groupIdPath}/${nodeJsArtifactId}/0.12.0/${nodeJsArtifactId}-0.12.0-darwin-x86.tar.gz",
38-
"${groupIdPath}/${nodeJsArtifactId}/0.12.0/${nodeJsArtifactId}-0.12.0-darwin-x64.tar.gz",
39-
"${groupIdPath}/${npmArtifactId}/1.4.9/${npmArtifactId}-1.4.9.pom",
40-
"${groupIdPath}/${npmArtifactId}/1.4.9/${npmArtifactId}-1.4.9.tgz"
32+
"${groupIdPath}/${nodeJsArtifactId}/${nodeJsSampleVersion}/${nodeJsArtifactId}-${nodeJsSampleVersion}.pom",
33+
"${groupIdPath}/${nodeJsArtifactId}/${nodeJsSampleVersion}/${nodeJsArtifactId}-${nodeJsSampleVersion}-windows-x86.exe",
34+
"${groupIdPath}/${nodeJsArtifactId}/${nodeJsSampleVersion}/${nodeJsArtifactId}-${nodeJsSampleVersion}-windows-x64.exe",
35+
"${groupIdPath}/${nodeJsArtifactId}/${nodeJsSampleVersion}/${nodeJsArtifactId}-${nodeJsSampleVersion}-linux-x86.tar.gz",
36+
"${groupIdPath}/${nodeJsArtifactId}/${nodeJsSampleVersion}/${nodeJsArtifactId}-${nodeJsSampleVersion}-linux-x64.tar.gz",
37+
"${groupIdPath}/${nodeJsArtifactId}/${nodeJsSampleVersion}/${nodeJsArtifactId}-${nodeJsSampleVersion}-darwin-x64.tar.gz",
38+
"${groupIdPath}/${npmArtifactId}/${npmSampleVersion}/${npmArtifactId}-${npmSampleVersion}.pom",
39+
"${groupIdPath}/${npmArtifactId}/${npmSampleVersion}/${npmArtifactId}-${npmSampleVersion}.tgz"
4140
};
4241

4342
private IndexPageBuilder() {
@@ -54,22 +53,27 @@ public static String build(MavenProxyConfiguration config) {
5453
url = StringUtils.replace(url, "${groupIdPath}", StringUtils.replace(config.getGroupId(), ".", "/"));
5554
url = StringUtils.replace(url, "${nodeJsArtifactId}", config.getNodeJsArtifactId());
5655
url = StringUtils.replace(url, "${npmArtifactId}", config.getNpmArtifactId());
56+
url = StringUtils.replace(url, "${nodeJsSampleVersion}", config.getNodeJsSampleVersion());
57+
url = StringUtils.replace(url, "${npmSampleVersion}", config.getNpmSampleVersion());
5758
exampleUrlsMarkup.append("<li><a href=\"").append(url).append("\">").append(url).append("</a></li>");
5859

5960
}
6061

6162
String serviceVersion = IndexPageBuilder.class.getPackage().getImplementationVersion();
6263

63-
return "<html>"
64-
+ "<head><title>Maven NodeJS Proxy</title></head>"
64+
return "<!DOCTYPE html>\n<html>"
65+
+ "<head>"
66+
+ "<title>Maven NodeJS Proxy</title>"
67+
+ "<style>body { font-family: sans-serif; }</style>"
68+
+ "</head>"
6569
+ "<body>"
6670
+ "<h1>Maven NodeJS Proxy</h1>"
6771
+ "<p>This is a Maven Artifact Proxy for NodeJS binaries located at: "
6872
+ "<a href=\"" + config.getNodeJsBinariesRootUrl() + "\">" + config.getNodeJsBinariesRootUrl() + "</a></p>"
6973
+ "<p>Every call to this repository is routed directly to this URL.</p>"
7074
+ "<p><strong>Please never use this Maven repository directly in your maven builds, but only via an Repository Manager "
7175
+ "which caches the resolved artifacts.</strong></p>"
72-
+ "<p>If you want to setup your own proxy get the source code:"
76+
+ "<p>If you want to setup your own proxy get the source code: "
7377
+ "<a href=\"https://github.com/wcm-io-devops/maven-nodejs-proxy\">https://github.com/wcm-io-devops/maven-nodejs-proxy</a></p>"
7478
+ "<hr/>"
7579
+ "<p>Examples:</p>"

0 commit comments

Comments
 (0)