Skip to content

Commit 65ac792

Browse files
committed
Merge branch 'feature/dropwizard-project-setup' into develop
2 parents 7765fbd + bd6cdf4 commit 65ac792

File tree

12 files changed

+1132
-0
lines changed

12 files changed

+1132
-0
lines changed

maven-nodejs-proxy/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dependency-reduced-pom.xml

maven-nodejs-proxy/config.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Group Id to publish artifacts to
2+
groupId: io.wcm.maven.proxy.nodejs
3+
4+
# Artifact Id to publish NodeJS binaries
5+
nodeJsArtifactId: nodejs-binaries
6+
7+
# Artifact Id to publish NPM binaries
8+
npmArtifactId: npm-binaries
9+
10+
# Root URL to download NodeJS binaries from
11+
nodeJsBinariesRootUrl: "https://nodejs.org/dist"
12+
13+
# Url parts to download the different artifacts
14+
nodeJsBinariesUrl: "/v${version}/node-v${version}-${os}-${arch}.${type}"
15+
nodeJsBinariesUrlWindows: "/v${version}/${arch}/node.${type}"
16+
nodeJsBinariesUrlWindowsX86: "/v${version}/node.${type}"
17+
npmBinariesUrl: "/npm/npm-${version}.${type}"
18+
19+
# SHA-1 checksums file
20+
nodeJsChecksumUrl: "/v${version}/SHASUMS.txt"
21+
22+
# HTTP Client settings
23+
httpClientConnectTimeout: 5000
24+
httpClientSocketTimeout: 15000
25+
26+
# Dropwizard config
27+
server:
28+
# Disable gzip compression to avoid corruption of tar.gz files
29+
gzip:
30+
enabled: false

maven-nodejs-proxy/pom.xml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
#%L
4+
wcm.io
5+
%%
6+
Copyright (C) 2015 wcm.io
7+
%%
8+
Licensed under the Apache License, Version 2.0 (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
19+
#L%
20+
-->
21+
22+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
23+
<modelVersion>4.0.0</modelVersion>
24+
25+
<parent>
26+
<groupId>io.wcm.devops</groupId>
27+
<artifactId>io.wcm.devops.parent_toplevel</artifactId>
28+
<version>1.0.0</version>
29+
<relativePath />
30+
</parent>
31+
32+
<groupId>io.wcm.devops.maven</groupId>
33+
<artifactId>io.wcm.devops.maven.nodejs-proxy</artifactId>
34+
<version>1.0.0-SNAPSHOT</version>
35+
<packaging>jar</packaging>
36+
37+
<name>Maven NodeJS Proxy</name>
38+
<description>Maven proxy to download NodeJS binaries as Maven artifacts.</description>
39+
40+
<properties>
41+
<dropwizard.version>0.9.0-rc4</dropwizard.version>
42+
</properties>
43+
44+
<dependencies>
45+
46+
<dependency>
47+
<groupId>io.dropwizard</groupId>
48+
<artifactId>dropwizard-core</artifactId>
49+
<version>${dropwizard.version}</version>
50+
<scope>compile</scope>
51+
</dependency>
52+
53+
<dependency>
54+
<groupId>org.apache.httpcomponents</groupId>
55+
<artifactId>httpclient</artifactId>
56+
<version>4.5</version>
57+
<scope>compile</scope>
58+
</dependency>
59+
60+
<dependency>
61+
<groupId>commons-io</groupId>
62+
<artifactId>commons-io</artifactId>
63+
<version>2.4</version>
64+
<scope>compile</scope>
65+
</dependency>
66+
67+
<dependency>
68+
<groupId>commons-codec</groupId>
69+
<artifactId>commons-codec</artifactId>
70+
<version>1.10</version>
71+
<scope>compile</scope>
72+
</dependency>
73+
74+
</dependencies>
75+
76+
<build>
77+
<plugins>
78+
79+
<plugin>
80+
<groupId>org.apache.maven.plugins</groupId>
81+
<artifactId>maven-shade-plugin</artifactId>
82+
<version>2.3</version>
83+
<configuration>
84+
<createDependencyReducedPom>true</createDependencyReducedPom>
85+
<filters>
86+
<filter>
87+
<artifact>*:*</artifact>
88+
<excludes>
89+
<exclude>META-INF/*.SF</exclude>
90+
<exclude>META-INF/*.DSA</exclude>
91+
<exclude>META-INF/*.RSA</exclude>
92+
</excludes>
93+
</filter>
94+
</filters>
95+
</configuration>
96+
<executions>
97+
<execution>
98+
<phase>package</phase>
99+
<goals>
100+
<goal>shade</goal>
101+
</goals>
102+
<configuration>
103+
<transformers>
104+
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
105+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
106+
<mainClass>io.wcm.devops.maven.nodejsproxy.MavenProxyApplication</mainClass>
107+
</transformer>
108+
</transformers>
109+
</configuration>
110+
</execution>
111+
</executions>
112+
</plugin>
113+
114+
<plugin>
115+
<groupId>org.apache.maven.plugins</groupId>
116+
<artifactId>maven-jar-plugin</artifactId>
117+
<configuration>
118+
<archive>
119+
<manifest>
120+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
121+
</manifest>
122+
</archive>
123+
</configuration>
124+
</plugin>
125+
126+
</plugins>
127+
</build>
128+
129+
</project>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* #%L
3+
* wcm.io
4+
* %%
5+
* Copyright (C) 2015 wcm.io
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
package io.wcm.devops.maven.nodejsproxy;
21+
22+
import io.dropwizard.Application;
23+
import io.dropwizard.setup.Bootstrap;
24+
import io.dropwizard.setup.Environment;
25+
import io.wcm.devops.maven.nodejsproxy.health.NodeJsDistHealthCheck;
26+
import io.wcm.devops.maven.nodejsproxy.resource.MavenProxyResource;
27+
28+
/**
29+
* Dropwizard Application for Maven NodeJS Proxy.
30+
*/
31+
public class MavenProxyApplication extends Application<MavenProxyConfiguration> {
32+
33+
@Override
34+
public String getName() {
35+
return "maven-nodejs-proxy";
36+
}
37+
38+
@Override
39+
public void initialize(Bootstrap<MavenProxyConfiguration> bootstrap) {
40+
// nothing to do yet
41+
}
42+
43+
@Override
44+
public void run(MavenProxyConfiguration configuration,
45+
Environment environment) {
46+
final MavenProxyResource resource = new MavenProxyResource(configuration);
47+
48+
final NodeJsDistHealthCheck healthCheck = new NodeJsDistHealthCheck(configuration);
49+
environment.healthChecks().register("nodeJsDist", healthCheck);
50+
51+
environment.jersey().register(resource);
52+
}
53+
54+
//CHECKSTYLE:OFF
55+
public static void main(String[] args) throws Exception {
56+
new MavenProxyApplication().run(args);
57+
}
58+
//CHECKSTYLE:ON
59+
60+
}
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
/*
2+
* #%L
3+
* wcm.io
4+
* %%
5+
* Copyright (C) 2015 wcm.io
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
package io.wcm.devops.maven.nodejsproxy;
21+
22+
import io.dropwizard.Configuration;
23+
24+
import org.hibernate.validator.constraints.NotEmpty;
25+
26+
import com.fasterxml.jackson.annotation.JsonProperty;
27+
28+
/**
29+
* Configuration for Maven NodeJS Proxy.
30+
*/
31+
public class MavenProxyConfiguration extends Configuration {
32+
33+
@NotEmpty
34+
private String groupId;
35+
@NotEmpty
36+
private String nodeJsArtifactId;
37+
@NotEmpty
38+
private String npmArtifactId;
39+
@NotEmpty
40+
private String nodeJsBinariesRootUrl;
41+
@NotEmpty
42+
private String nodeJsBinariesUrl;
43+
@NotEmpty
44+
private String nodeJsBinariesUrlWindows;
45+
@NotEmpty
46+
private String nodeJsBinariesUrlWindowsX86;
47+
@NotEmpty
48+
private String npmBinariesUrl;
49+
@NotEmpty
50+
private String nodeJsChecksumUrl;
51+
private int httpClientConnectTimeout = 5000;
52+
private int httpClientSocketTimeout = 15000;
53+
54+
@JsonProperty
55+
public String getGroupId() {
56+
return this.groupId;
57+
}
58+
59+
@JsonProperty
60+
public void setGroupId(String groupId) {
61+
this.groupId = groupId;
62+
}
63+
64+
@JsonProperty
65+
public String getNodeJsArtifactId() {
66+
return this.nodeJsArtifactId;
67+
}
68+
69+
@JsonProperty
70+
public void setNodeJsArtifactId(String nodeJsArtifactId) {
71+
this.nodeJsArtifactId = nodeJsArtifactId;
72+
}
73+
74+
@JsonProperty
75+
public String getNpmArtifactId() {
76+
return this.npmArtifactId;
77+
}
78+
79+
@JsonProperty
80+
public void setNpmArtifactId(String npmArtifactId) {
81+
this.npmArtifactId = npmArtifactId;
82+
}
83+
84+
@JsonProperty
85+
public String getNodeJsBinariesRootUrl() {
86+
return this.nodeJsBinariesRootUrl;
87+
}
88+
89+
@JsonProperty
90+
public void setNodeJsBinariesRootUrl(String nodeJsBinariesRootUrl) {
91+
this.nodeJsBinariesRootUrl = nodeJsBinariesRootUrl;
92+
}
93+
94+
@JsonProperty
95+
public String getNodeJsBinariesUrl() {
96+
return this.nodeJsBinariesUrl;
97+
}
98+
99+
@JsonProperty
100+
public void setNodeJsBinariesUrl(String nodeJsBinariesUrl) {
101+
this.nodeJsBinariesUrl = nodeJsBinariesUrl;
102+
}
103+
104+
@JsonProperty
105+
public String getNodeJsBinariesUrlWindows() {
106+
return this.nodeJsBinariesUrlWindows;
107+
}
108+
109+
@JsonProperty
110+
public void setNodeJsBinariesUrlWindows(String nodeJsBinariesUrlWindows) {
111+
this.nodeJsBinariesUrlWindows = nodeJsBinariesUrlWindows;
112+
}
113+
114+
@JsonProperty
115+
public String getNodeJsBinariesUrlWindowsX86() {
116+
return this.nodeJsBinariesUrlWindowsX86;
117+
}
118+
119+
@JsonProperty
120+
public void setNodeJsBinariesUrlWindowsX86(String nodeJsBinariesUrlWindowsX86) {
121+
this.nodeJsBinariesUrlWindowsX86 = nodeJsBinariesUrlWindowsX86;
122+
}
123+
124+
@JsonProperty
125+
public String getNpmBinariesUrl() {
126+
return this.npmBinariesUrl;
127+
}
128+
129+
@JsonProperty
130+
public void setNpmBinariesUrl(String npmBinariesUrl) {
131+
this.npmBinariesUrl = npmBinariesUrl;
132+
}
133+
@JsonProperty
134+
public String getNodeJsChecksumUrl() {
135+
return this.nodeJsChecksumUrl;
136+
}
137+
138+
@JsonProperty
139+
public void setNodeJsChecksumUrl(String nodeJsChecksumUrl) {
140+
this.nodeJsChecksumUrl = nodeJsChecksumUrl;
141+
}
142+
143+
@JsonProperty
144+
public int getHttpClientConnectTimeout() {
145+
return this.httpClientConnectTimeout;
146+
}
147+
148+
@JsonProperty
149+
public void setHttpClientConnectTimeout(int httpClientConnectTimeout) {
150+
this.httpClientConnectTimeout = httpClientConnectTimeout;
151+
}
152+
153+
@JsonProperty
154+
public int getHttpClientSocketTimeout() {
155+
return this.httpClientSocketTimeout;
156+
}
157+
158+
@JsonProperty
159+
public void setHttpClientSocketTimeout(int httpClientSocketTimeout) {
160+
this.httpClientSocketTimeout = httpClientSocketTimeout;
161+
}
162+
163+
}

0 commit comments

Comments
 (0)