Error message:: "Command 'mvn license:download-licenses' failed to execute"

263 views
Skip to first unread message

Balkrishnan V

unread,
Jan 11, 2017, 9:53:01 PM1/11/17
to license-finder
Hi

I have installed License Finder on "Ubuntu 16.04", along with other package-managers (viz., mvn, npm, bower, bundler, pip, gradle, rebar, nuget).

My objective:  is to run license_finder command successfully in "httpcomponents-core-4.4.5/httpcore" folder that contains pom.xml file.

Result: I get to see an error. which I do not know how to resolve. The error-log is attached below.  Could you please provide me any pointers to resolve this issue?

XXXXXXXXXXXXXXXXXXXXX:~/httpcomponents-core-4.4.5/httpcore$ license_finder --debug
LicenseFinder::GoDep: is not installed
LicenseFinder::GoWorkspace: is not installed
LicenseFinder::GoVendor: is not installed
LicenseFinder::Bundler: is installed
LicenseFinder::Bundler: is not active
LicenseFinder::NPM: is installed
LicenseFinder::NPM: is not active
LicenseFinder::Pip: is installed
LicenseFinder::Pip: is not active
LicenseFinder::Bower: is installed
LicenseFinder::Bower: is not active
LicenseFinder::Maven: is installed
LicenseFinder::Maven: is active
LicenseFinder::Gradle: is installed
LicenseFinder::Gradle: is not active
LicenseFinder::CocoaPods: no command defined
LicenseFinder::CocoaPods: is not active
LicenseFinder::Rebar: is installed
LicenseFinder::Rebar: is not active
LicenseFinder::Nuget: no command defined
LicenseFinder::Nuget: is not active
/var/lib/gems/2.3.0/gems/license_finder-2.1.2/lib/license_finder/package_managers/maven.rb:8:in `current_packages': Command 'mvn license:download-licenses' failed to execute: [INFO] Scanning for projects... (RuntimeError)
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.apache.httpcomponents:httpcomponents-core:4.4.5: Could not transfer artifact org.apache.httpcomponents:project:pom:7 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/xxx.xxx.xxx.xxx] failed: Connection timed out (Connection timed out) and 'parent.relativePath' points at wrong local POM @ org.apache.httpcomponents:httpcomponents-core:4.4.5, /home/a123456/httpcomponents-core-4.4.5/pom.xml, line 27, column 11
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project org.apache.httpcomponents:httpcore:[unknown-version] (/home/a123456/httpcomponents-core-4.4.5/httpcore/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for org.apache.httpcomponents:httpcomponents-core:4.4.5: Could not transfer artifact org.apache.httpcomponents:project:pom:7 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/xxx.xxx.xxx.xxx] failed: Connection timed out (Connection timed out) and 'parent.relativePath' points at wrong local POM @ org.apache.httpcomponents:httpcomponents-core:4.4.5, /home/a123456/httpcomponents-core-4.4.5/pom.xml, line 27, column 11 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
        from /var/lib/gems/2.3.0/gems/license_finder-2.1.2/lib/license_finder/package_manager.rb:60:in `current_packages_with_relations'
        from /var/lib/gems/2.3.0/gems/license_finder-2.1.2/lib/license_finder/package_manager.rb:23:in `each'
        from /var/lib/gems/2.3.0/gems/license_finder-2.1.2/lib/license_finder/package_manager.rb:23:in `flat_map'
        from /var/lib/gems/2.3.0/gems/license_finder-2.1.2/lib/license_finder/package_manager.rb:23:in `current_packages'
        from /var/lib/gems/2.3.0/gems/license_finder-2.1.2/lib/license_finder/core.rb:63:in `current_packages'
        from /var/lib/gems/2.3.0/gems/license_finder-2.1.2/lib/license_finder/core.rb:58:in `decision_applier'
        from /var/lib/gems/2.3.0/gems/license_finder-2.1.2/lib/license_finder/cli/main.rb:36:in `action_items'
        from /var/lib/gems/2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
        from /var/lib/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
        from /var/lib/gems/2.3.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'

Kim Dykeman

unread,
Jan 12, 2017, 12:43:52 AM1/12/17
to Balkrishnan V, license-finder
Hi Balki,

The issue looks to me to be network related rather than an issue with your license_finder installation. 

For projects using maven, license_finder invokes the maven goal "license:download-licenses".  This goal downloads the licenses for all of the dependencies from an appropriate maven repository (typically a remote repo).  It looks like the issue you're running into is that maven is not able to connect to the remote maven repo for some reason.  The error message is saying that there was a timeout while it was trying to download https://repo.maven.apache.org/maven2/org/apache/httpcomponents/project/7/project-7.pom.

A couple of things that may help with troubleshooting:
  1. On your Ubuntu box, are you able to use wget or curl to download the file at https://repo.maven.apache.org/maven2/org/apache/httpcomponents/project/7/project-7.pom?  If not, then it's likely a network or routing related issue.
  2. If you are able to download that url, then maybe run the maven goal with the debug flag to get more information (i.e. `mvn -X license:download-licenses`)
For what it's worth, I was able to successfully run license_finder in httpcomponents-core-4.4.5/httpcore extracted from a src zip file I downloaded.  I've attached the output from my debug run for comparison.

--
You received this message because you are subscribed to the Google Groups "license-finder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to license-finde...@googlegroups.com.
license_finder_httpcore_debug_log.txt

Balkrishnan V

unread,
Jan 12, 2017, 10:39:10 PM1/12/17
to license-finder, balkrishnan....@gmail.com
Hi Kim

Thanks for your time!

"wget" from httpcomponents-core-4.4.5/httpcore folder worked fine and downloaded the 'project-7.pom' in the same folder. So the network issue could be ruled out as you had mentioned.

I ran the "mvn -X license:download-licenses" within the httpcomponents-core-4.4.5/httpcore folder and reviewing the trace. I think the issue might be related to the maven-configurations.

Once I find the issue I will post the resolution here so it might be helpful for others.

Balkrishnan V

unread,
Jan 13, 2017, 1:07:29 AM1/13/17
to license-finder, balkrishnan....@gmail.com
The issue was a proxy-setting within the

Now I am able to run the license_finder command:

 ~/httpcomponents-core-4.4.5/httpcore$ license_finder
..........................
Dependencies that need approval:
commons-logging, 1.2, "Apache 2.0"
hamcrest-core, 1.3, "New BSD License"
junit, 4.11, "Common Public License Version 1.0"
mockito-core, 1.8.5, "The MIT License"
objenesis, 1.0, MIT

Thanks again Kim!

Balkrishnan V

unread,
Jan 13, 2017, 1:08:17 AM1/13/17
to license-finder, balkrishnan....@gmail.com
The issue was a proxy-setting within the ~/.m2/settings.xml file

Kim Dykeman

unread,
Jan 13, 2017, 3:32:36 AM1/13/17
to Balkrishnan V, license-finder
Ah, I hadn't thought about that.  Nice find!
Reply all
Reply to author
Forward
0 new messages