Skip to content

Commit a90ba72

Browse files
committed
[jgitflow-maven-plugin] merging 'release/1.2.0' into 'master'
2 parents cd0ef72 + 8fa83b5 commit a90ba72

File tree

11 files changed

+72
-55
lines changed

11 files changed

+72
-55
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pom.xml.versionsBackup
55
pom.xml.next
66
release.properties
77
maven-eclipse.xml
8+
infinitest.filters
89

910
node_modules/
1011
npm-debug.log
@@ -17,10 +18,12 @@ npm-debug.log
1718
.pmd
1819
.checkstyle
1920
.idea
20-
.iml
21+
.vagrant
22+
*.iml
2123
.DS_Store
2224
.rubygems
2325
.sass-cache
2426
.rubygems-gem-maven-plugin
2527
*.sublime-*
28+
*nbactions*.xml
2629
.temp/

.travis.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,22 @@ language: java
2121

2222
jdk:
2323
- oraclejdk8
24+
- openjdk11
2425

2526
# Make sure travis can use container-based infrastructure
2627
sudo: false
2728

2829
install: "mvn -s ./.travis.maven-settings.xml clean"
2930

3031
script:
31-
- "mvn -s ./.travis.maven-settings.xml -Pcontinuous-integration -U -Dmaven.javadoc.skip=true install"
32+
- "mvn -s ./.travis.maven-settings.xml -Pcontinuous-integration -U install"
3233
# Remove wcm.io artefacts from repository before cache
3334
- rm -rf $HOME/.m2/repository/io/wcm
3435

35-
# exlude release tags like xyz-1.0.0 or xyz-1
36+
# exlude release tags like 1.0.0
3637
branches:
3738
except:
38-
- /^.*\-\d+(\.\d+\.\d+)?(\..*|\-.*)?$/
39+
- /^\d+(\.\d+\.\d+)?(\..*|\-.*)?$/
3940

4041
# Cache Maven Repository
4142
cache:

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ Steps to build and start the proxy:
1818
---
1919

2020
A public instance of this proxy is available at: https://maven-nodejs-proxy.pvtool.org/
21+
22+
A Ansible role for this proxy is available at:
23+
https://github.com/wcm-io-devops/ansible-maven-nodejs-proxy

changes.xml

+9
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@
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.2.0" date="2019-04-05">
27+
<action type="add" dev="sseifert">
28+
Add support for downloading Windows NodeJS binaries as ZIP including NPM which is available since Node 6.3.0.
29+
</action>
30+
<action type="update" dev="sseifert">
31+
Update to dropwizard 1.3.9.
32+
</action>
33+
</release>
34+
2635
<release version="1.1.0" date="2016-03-22">
2736
<action type="update" dev="sseifert" issue="WDEVOP-1">
2837
Binary File Structre changed in NPM Versions > 0.x and support for SHA-256 checksums.

maven-nodejs-proxy/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ npmBinariesUrl: "/npm/npm-${version}.${type}"
2424
nodeJsChecksumUrl: "/v${version}/SHASUMS256.txt"
2525

2626
# Sample versions for index page
27-
nodeJsSampleVersion: 4.4.0
27+
nodeJsSampleVersion: 10.15.0
2828
npmSampleVersion: 1.4.9
2929

3030
# HTTP Client settings

maven-nodejs-proxy/pom.xml

+10-10
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.2</version>
28+
<version>1.1.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.1.0</version>
34+
<version>1.2.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.2</dropwizard.version>
41+
<dropwizard.version>1.3.9</dropwizard.version>
4242
</properties>
4343

4444
<dependencies>
@@ -61,18 +61,18 @@
6161
<version>${dropwizard.version}</version>
6262
<scope>test</scope>
6363
</dependency>
64-
64+
6565
<dependency>
6666
<groupId>commons-io</groupId>
6767
<artifactId>commons-io</artifactId>
68-
<version>2.4</version>
68+
<version>2.6</version>
6969
<scope>compile</scope>
7070
</dependency>
7171

7272
<dependency>
7373
<groupId>commons-codec</groupId>
7474
<artifactId>commons-codec</artifactId>
75-
<version>1.10</version>
75+
<version>1.12</version>
7676
<scope>compile</scope>
7777
</dependency>
7878

@@ -84,10 +84,10 @@
8484
</dependency>
8585

8686
</dependencies>
87-
87+
8888
<build>
8989
<plugins>
90-
90+
9191
<plugin>
9292
<groupId>org.apache.maven.plugins</groupId>
9393
<artifactId>maven-shade-plugin</artifactId>
@@ -120,8 +120,8 @@
120120
</configuration>
121121
</execution>
122122
</executions>
123-
</plugin>
124-
123+
</plugin>
124+
125125
<plugin>
126126
<groupId>org.apache.maven.plugins</groupId>
127127
<artifactId>maven-jar-plugin</artifactId>

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

+24-26
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ public final class IndexPageBuilder {
3030

3131
private static final String[] EXAMPLE_URLS = new String[] {
3232
"${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",
33+
"${groupIdPath}/${nodeJsArtifactId}/${nodeJsSampleVersion}/${nodeJsArtifactId}-${nodeJsSampleVersion}-win-x86.zip",
34+
"${groupIdPath}/${nodeJsArtifactId}/${nodeJsSampleVersion}/${nodeJsArtifactId}-${nodeJsSampleVersion}-win-x64.zip",
3635
"${groupIdPath}/${nodeJsArtifactId}/${nodeJsSampleVersion}/${nodeJsArtifactId}-${nodeJsSampleVersion}-linux-x64.tar.gz",
3736
"${groupIdPath}/${nodeJsArtifactId}/${nodeJsSampleVersion}/${nodeJsArtifactId}-${nodeJsSampleVersion}-darwin-x64.tar.gz",
3837
"${groupIdPath}/${npmArtifactId}/${npmSampleVersion}/${npmArtifactId}-${npmSampleVersion}.pom",
@@ -56,34 +55,33 @@ public static String build(MavenProxyConfiguration config) {
5655
url = StringUtils.replace(url, "${nodeJsSampleVersion}", config.getNodeJsSampleVersion());
5756
url = StringUtils.replace(url, "${npmSampleVersion}", config.getNpmSampleVersion());
5857
exampleUrlsMarkup.append("<li><a href=\"").append(url).append("\">").append(url).append("</a></li>");
59-
6058
}
6159

6260
String serviceVersion = IndexPageBuilder.class.getPackage().getImplementationVersion();
6361

6462
return "<!DOCTYPE html>\n<html>"
65-
+ "<head>"
66-
+ "<title>Maven NodeJS Proxy</title>"
67-
+ "<style>body { font-family: sans-serif; }</style>"
68-
+ "</head>"
69-
+ "<body>"
70-
+ "<h1>Maven NodeJS Proxy</h1>"
71-
+ "<p>This is a Maven Artifact Proxy for NodeJS binaries located at: "
72-
+ "<a href=\"" + config.getNodeJsBinariesRootUrl() + "\">" + config.getNodeJsBinariesRootUrl() + "</a></p>"
73-
+ "<p>Every call to this repository is routed directly to this URL.</p>"
74-
+ "<p><strong>Please never use this Maven repository directly in your maven builds, but only via an Repository Manager "
75-
+ "which caches the resolved artifacts.</strong></p>"
76-
+ "<p>If you want to setup your own proxy get the source code: "
77-
+ "<a href=\"https://github.com/wcm-io-devops/maven-nodejs-proxy\">https://github.com/wcm-io-devops/maven-nodejs-proxy</a></p>"
78-
+ "<hr/>"
79-
+ "<p>Examples:</p>"
80-
+ "<ul>"
81-
+ exampleUrlsMarkup
82-
+ "</ul>"
83-
+ "<p>For all files SHA1 checksums are supported (.sha1 suffix). MD5 checksums are not supported.</p>"
84-
+ (serviceVersion != null ? "<hr/><p>Version " + IndexPageBuilder.class.getPackage().getImplementationVersion() + ".</p>" : "")
85-
+ "</body>"
86-
+ "</html>";
63+
+ "<head>"
64+
+ "<title>Maven NodeJS Proxy</title>"
65+
+ "<style>body { font-family: sans-serif; }</style>"
66+
+ "</head>"
67+
+ "<body>"
68+
+ "<h1>Maven NodeJS Proxy</h1>"
69+
+ "<p>This is a Maven Artifact Proxy for NodeJS binaries located at: "
70+
+ "<a href=\"" + config.getNodeJsBinariesRootUrl() + "\">" + config.getNodeJsBinariesRootUrl() + "</a></p>"
71+
+ "<p>Every call to this Maven repository is routed directly to the NodeJS distribution server.</p>"
72+
+ "<p><strong>Please never use this Maven repository directly in your maven builds, use it only via a Repository Manager "
73+
+ "which caches the resolved artifacts.</strong></p>"
74+
+ "<p>If you want to setup your own proxy get the source code: "
75+
+ "<a href=\"https://github.com/wcm-io-devops/maven-nodejs-proxy\">https://github.com/wcm-io-devops/maven-nodejs-proxy</a></p>"
76+
+ "<hr/>"
77+
+ "<p>Example artifacts:</p>"
78+
+ "<ul>"
79+
+ exampleUrlsMarkup
80+
+ "</ul>"
81+
+ "<p>For all files SHA1 checksums are supported (.sha1 suffix). MD5 checksums are not supported.</p>"
82+
+ (serviceVersion != null ? "<hr/><p>Version " + IndexPageBuilder.class.getPackage().getImplementationVersion() + "</p>" : "")
83+
+ "</body>"
84+
+ "</html>";
8785
}
8886

8987
}

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public Response getBinary(
206206
}
207207

208208
String url = buildBinaryUrl(artifactType, version, null, null, StringUtils.removeEnd(type, ".sha1"));
209-
return getBinary(url, version, getChecksum, null);
209+
return getBinary(url, getChecksum, null);
210210
}
211211

212212
private Response getBinaryWithChecksumValidation(String url, String version, boolean getChecksum) throws IOException {
@@ -222,10 +222,10 @@ private Response getBinaryWithChecksumValidation(String url, String version, boo
222222
return Response.status(Response.Status.NOT_FOUND).build();
223223
}
224224

225-
return getBinary(url, version, getChecksum, checksum);
225+
return getBinary(url, getChecksum, checksum);
226226
}
227227

228-
private Response getBinary(String url, String version, boolean getChecksum, String expectedChecksum) throws IOException {
228+
private Response getBinary(String url, boolean getChecksum, String expectedChecksum) throws IOException {
229229
log.info("Proxy file: {}", url);
230230
HttpGet get = new HttpGet(url);
231231
HttpResponse response = httpClient.execute(get);
@@ -335,7 +335,7 @@ private String buildBinaryUrl(ArtifactType artifactType, String version, String
335335
String url;
336336
switch (artifactType) {
337337
case NODEJS:
338-
if (StringUtils.equals(os, "windows")) {
338+
if (StringUtils.equals(os, "windows") && StringUtils.equals(type, "exe")) {
339339
if (isVersion4Up(version)) {
340340
url = config.getNodeJsBinariesUrlWindows();
341341
}
@@ -358,7 +358,7 @@ else if (StringUtils.equals(arch, "x86")) {
358358
}
359359
url = config.getNodeJsBinariesRootUrl() + url;
360360
url = StringUtils.replace(url, "${version}", StringUtils.defaultString(version));
361-
url = StringUtils.replace(url, "${os}", StringUtils.defaultString(os));
361+
url = StringUtils.replace(url, "${os}", StringUtils.defaultString(StringUtils.replace(os, "windows", "win")));
362362
url = StringUtils.replace(url, "${arch}", StringUtils.defaultString(arch));
363363
url = StringUtils.replace(url, "${type}", StringUtils.defaultString(type));
364364
return url;

maven-nodejs-proxy/src/test/java/io/wcm/devops/maven/nodejsproxy/resource/MavenProxyResourceTest.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,20 @@
3636

3737
import io.dropwizard.testing.junit.ResourceTestRule;
3838

39-
4039
public class MavenProxyResourceTest {
4140

4241
// test with the following NodeJS and NPM versions
4342
private static final String[] NODEJS_VERSIONS = {
44-
"0.12.0",
45-
"4.4.0"
43+
"6.3.0",
44+
"10.15.0"
4645
};
4746
private static final String[] NODEJS_TARGETS = {
47+
"-windows-x86.zip",
48+
"-windows-x64.zip",
49+
"-win-x86.zip",
50+
"-win-x64.zip",
4851
"-windows-x86.exe",
4952
"-windows-x64.exe",
50-
"-linux-x86.tar.gz",
5153
"-linux-x64.tar.gz",
5254
"-darwin-x64.tar.gz"
5355
};
@@ -60,8 +62,8 @@ public class MavenProxyResourceTest {
6062

6163
@Rule
6264
public ResourceTestRule context = new ResourceTestRule.Builder()
63-
.addResource(new MavenProxyResource(TestContext.getConfiguration(), TestContext.getHttpClient()))
64-
.build();
65+
.addResource(new MavenProxyResource(TestContext.getConfiguration(), TestContext.getHttpClient()))
66+
.build();
6567

6668
@Test
6769
public void testGetIndex() {

maven-nodejs-proxy/src/test/java/io/wcm/devops/maven/nodejsproxy/resource/TestContext.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
import io.dropwizard.configuration.ConfigurationException;
3131
import io.dropwizard.configuration.ConfigurationFactory;
32+
import io.dropwizard.configuration.YamlConfigurationFactory;
3233
import io.dropwizard.jackson.Jackson;
3334
import io.wcm.devops.maven.nodejsproxy.MavenProxyConfiguration;
3435

@@ -41,7 +42,7 @@ private TestContext() {
4142
}
4243

4344
static MavenProxyConfiguration getConfiguration() {
44-
ConfigurationFactory factory = new ConfigurationFactory<MavenProxyConfiguration>(
45+
ConfigurationFactory factory = new YamlConfigurationFactory<MavenProxyConfiguration>(
4546
MavenProxyConfiguration.class, null, OBJECT_MAPPER, "override");
4647
try {
4748
File configFile = new File("config.yml");

pom.xml

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

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

3737
<name>Maven NodeJS Proxy Root</name>

0 commit comments

Comments
 (0)