Skip to content

Commit bd6cdf4

Browse files
committed
maven nodejs proxy
1 parent f91cdb0 commit bd6cdf4

File tree

14 files changed

+896
-200
lines changed

14 files changed

+896
-200
lines changed

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/example.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

maven-nodejs-proxy/pom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@
6464
<scope>compile</scope>
6565
</dependency>
6666

67+
<dependency>
68+
<groupId>commons-codec</groupId>
69+
<artifactId>commons-codec</artifactId>
70+
<version>1.10</version>
71+
<scope>compile</scope>
72+
</dependency>
73+
6774
</dependencies>
6875

6976
<build>
@@ -96,7 +103,7 @@
96103
<transformers>
97104
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
98105
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
99-
<mainClass>com.example.helloworld.HelloWorldApplication</mainClass>
106+
<mainClass>io.wcm.devops.maven.nodejsproxy.MavenProxyApplication</mainClass>
100107
</transformer>
101108
</transformers>
102109
</configuration>

maven-nodejs-proxy/src/main/java/com/example/helloworld/HelloWorldConfiguration.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

maven-nodejs-proxy/src/main/java/com/example/helloworld/health/TemplateHealthCheck.java

Lines changed: 0 additions & 41 deletions
This file was deleted.

maven-nodejs-proxy/src/main/java/com/example/helloworld/resources/HelloWorldResource.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

maven-nodejs-proxy/src/main/java/com/example/helloworld/HelloWorldApplication.java renamed to maven-nodejs-proxy/src/main/java/io/wcm/devops/maven/nodejsproxy/MavenProxyApplication.java

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,42 +17,44 @@
1717
* limitations under the License.
1818
* #L%
1919
*/
20-
package com.example.helloworld;
20+
package io.wcm.devops.maven.nodejsproxy;
2121

2222
import io.dropwizard.Application;
2323
import io.dropwizard.setup.Bootstrap;
2424
import io.dropwizard.setup.Environment;
25+
import io.wcm.devops.maven.nodejsproxy.health.NodeJsDistHealthCheck;
26+
import io.wcm.devops.maven.nodejsproxy.resource.MavenProxyResource;
2527

26-
import com.example.helloworld.health.TemplateHealthCheck;
27-
import com.example.helloworld.resources.HelloWorldResource;
28-
29-
public class HelloWorldApplication extends Application<HelloWorldConfiguration> {
30-
31-
public static void main(String[] args) throws Exception {
32-
new HelloWorldApplication().run(args);
33-
}
28+
/**
29+
* Dropwizard Application for Maven NodeJS Proxy.
30+
*/
31+
public class MavenProxyApplication extends Application<MavenProxyConfiguration> {
3432

3533
@Override
3634
public String getName() {
37-
return "hello-world";
35+
return "maven-nodejs-proxy";
3836
}
3937

4038
@Override
41-
public void initialize(Bootstrap<HelloWorldConfiguration> bootstrap) {
39+
public void initialize(Bootstrap<MavenProxyConfiguration> bootstrap) {
4240
// nothing to do yet
4341
}
4442

4543
@Override
46-
public void run(HelloWorldConfiguration configuration,
44+
public void run(MavenProxyConfiguration configuration,
4745
Environment environment) {
48-
final HelloWorldResource resource = new HelloWorldResource(
49-
configuration.getTemplate(),
50-
configuration.getDefaultName()
51-
);
52-
final TemplateHealthCheck healthCheck =
53-
new TemplateHealthCheck(configuration.getTemplate());
54-
environment.healthChecks().register("template", healthCheck);
46+
final MavenProxyResource resource = new MavenProxyResource(configuration);
47+
48+
final NodeJsDistHealthCheck healthCheck = new NodeJsDistHealthCheck(configuration);
49+
environment.healthChecks().register("nodeJsDist", healthCheck);
50+
5551
environment.jersey().register(resource);
5652
}
5753

54+
//CHECKSTYLE:OFF
55+
public static void main(String[] args) throws Exception {
56+
new MavenProxyApplication().run(args);
57+
}
58+
//CHECKSTYLE:ON
59+
5860
}

0 commit comments

Comments
 (0)