Uploaded image for project: 'Maven Checkstyle Plugin'
  1. Maven Checkstyle Plugin
  2. MCHECKSTYLE-316

Maven proxy settings is being ignored

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.16
    • None
    • checkstyle:check
    • None
    • Windows 7

    Description

      Hi,

      having a suppression location of https://raw.githubusercontent.com/wso2/code-quality-tools/master/checkstyle/suppressions.xml results in a call to
      DefaultCheckstyleExecutor.getSuppressionsFilePath():797
      which will try a resource lookup via DefaultResourceManager.getResourceAsFile() which will call URLResourceLoader.getResource()

      this will timeout and result in a ConnectionException.

      But in the underlying maven session a HTTP proxy is defined, but not used here.

      The DefaultBuildPluginManager.executeMojo() has the proxy information available in the MavenSession (session) as part of the request (DefaultMavenExecutionRequest) -> proxies

      So a fix would be to apply those configured proxies somehow to the checkstyle plugin, but I'm not sure who this is done best.

      Complete stack trace:
      Thread [main] (Suspended (exception ConnectException))
      owns: DualStackPlainSocketImpl (id=47)
      owns: HttpsClient (id=48)
      owns: DelegateHttpsURLConnection (id=49)
      owns: HttpsURLConnectionImpl (id=50)
      DualStackPlainSocketImpl.connect0(int, InetAddress, int) line: not available [native method]
      DualStackPlainSocketImpl.socketConnect(InetAddress, int, int) line: 79
      DualStackPlainSocketImpl(AbstractPlainSocketImpl).doConnect(InetAddress, int, int) line: 345
      DualStackPlainSocketImpl(AbstractPlainSocketImpl).connectToAddress(InetAddress, int, int) line: 206
      DualStackPlainSocketImpl(AbstractPlainSocketImpl).connect(SocketAddress, int) line: 188
      SocksSocketImpl(PlainSocketImpl).connect(SocketAddress, int) line: 172
      SocksSocketImpl.connect(SocketAddress, int) line: 392
      SSLSocketImpl(Socket).connect(SocketAddress, int) line: 589
      SSLSocketImpl.connect(SocketAddress, int) line: 656
      SSLSocketImpl(BaseSSLSocketImpl).connect(SocketAddress) line: 173
      HttpsClient(NetworkClient).doConnect(String, int) line: 180
      HttpsClient(HttpClient).openServer(String, int) line: 432
      HttpsClient(HttpClient).openServer() line: 527
      HttpsClient.<init>(SSLSocketFactory, URL, Proxy, int) line: 275
      HttpsClient.New(SSLSocketFactory, URL, HostnameVerifier, Proxy, boolean, int, HttpURLConnection) line: 371
      DelegateHttpsURLConnection(AbstractDelegateHttpsURLConnection).getNewHttpClient(URL, Proxy, int) line: 191
      DelegateHttpsURLConnection(HttpURLConnection).plainConnect0() line: 1104
      DelegateHttpsURLConnection(HttpURLConnection).plainConnect() line: 998 [local variables unavailable]
      DelegateHttpsURLConnection(AbstractDelegateHttpsURLConnection).connect() line: 177
      DelegateHttpsURLConnection(HttpURLConnection).getInputStream0() line: 1512
      DelegateHttpsURLConnection(HttpURLConnection).getInputStream() line: 1440
      HttpsURLConnectionImpl.getInputStream() line: 254 [local variables unavailable]
      URL.openStream() line: 1038 [local variables unavailable]
      URLResourceLoader.getResource(String) line: 73
      DefaultResourceManager.getResource(String) line: 159
      DefaultResourceManager.getResourceAsFile(String, String) line: 91
      DefaultCheckstyleExecutor.getSuppressionsFilePath(CheckstyleExecutorRequest) line: 797
      DefaultCheckstyleExecutor.executeCheckstyle(CheckstyleExecutorRequest) line: 117
      CheckstyleViolationCheckMojo.execute() line: 538
      DefaultBuildPluginManager.executeMojo(MavenSession, MojoExecution) line: 132
      MojoExecutor.execute(MavenSession, MojoExecution, ProjectIndex, DependencyContext) line: 208
      MojoExecutor.execute(MavenSession, MojoExecution, ProjectIndex, DependencyContext, PhaseRecorder) line: 153
      MojoExecutor.execute(MavenSession, List<MojoExecution>, ProjectIndex) line: 145
      LifecycleModuleBuilder.buildProject(MavenSession, MavenSession, ReactorContext, MavenProject, TaskSegment) line: 116
      LifecycleModuleBuilder.buildProject(MavenSession, ReactorContext, MavenProject, TaskSegment) line: 80
      SingleThreadedBuilder.build(MavenSession, ReactorContext, ProjectBuildList, List<TaskSegment>, ReactorBuildStatus) line: 51
      LifecycleStarter.execute(MavenSession) line: 120
      DefaultMaven.doExecute(MavenExecutionRequest) line: 347
      DefaultMaven.execute(MavenExecutionRequest) line: 154
      MavenCli.execute(MavenCli$CliRequest) line: 582
      MavenCli.doMain(MavenCli$CliRequest) line: 214
      MavenCli.main(String[], ClassWorld) line: 158
      NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
      NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62
      DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
      Method.invoke(Object, Object...) line: 497
      Launcher.launchEnhanced(String[]) line: 289
      Launcher.launch(String[]) line: 229
      Launcher.mainWithExitCode(String[]) line: 415
      Launcher.main(String[]) line: 356

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              meyert Thomas Meyer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: