treasure-data / digdag

Workload Automation System
https://www.digdag.io/
Apache License 2.0
1.3k stars 221 forks source link

plugin installation is failed in proxy environment #762

Open e-mon opened 6 years ago

e-mon commented 6 years ago

In the proxy environment plugin loading function does not seem to work.

Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact com.github.szyn:digdag-slack:pom:0.1.2 from/to central (http://central.maven.org/maven2/): Connect to central.maven.org:80 timed out

I tried putting proxy setting in ~/.m2/settings.xml and set environment variables ( http_proxy, https_proxy ) , but it still does not work.

my environment:

openjdk version "1.8.0_162"
OpenJDK Runtime Environment (Zulu 8.27.0.7-linux64) (build 1.8.0_162-b01)
OpenJDK 64-Bit Server VM (Zulu 8.27.0.7-linux64) (build 25.162-b01, mixed mode)

digdag version: 0.9.24

How to set proxy for loading plugin?

hiroyuki-sato commented 6 years ago

Hello, @e-mon

IIUC, Plugin loading does not support Proxy yet.

https://github.com/treasure-data/digdag/blob/master/digdag-core/src/main/java/io/digdag/core/plugin/RemotePluginLoader.java#L49-L50

    private static final List<RemoteRepository> DEFAULT_REPOSITORIES = ImmutableList.copyOf(new RemoteRepository[] {
        new RemoteRepository.Builder("central", "default", "http://central.maven.org/maven2/").build(),
        new RemoteRepository.Builder("jcenter", "default", "http://jcenter.bintray.com/").build(),
    });

The RemoteRepository.Builder needs to set proxy parameter. https://maven.apache.org/resolver/apidocs/org/eclipse/aether/repository/RemoteRepository.Builder.html#setProxy(org.eclipse.aether.repository.Proxy)

hiroyuki-sato commented 6 years ago

I checked current implementation.

It requires the following consideration to implement the proxy setting for RemotePluginLoader.

This change is rough test implementation.