ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to compile a rosjava package offline?

asked 2016-02-15 03:27:25 -0500

Manuel gravatar image

Hello, I tried to compile a rosjava package without internet connection and it complained about not being able to reach ""

FAILURE: Build failed with an exception.
* What went wrong:
> Could not read script ''.

After that, I tried again with internec connection and it compiled. I would like to be able to code without internet connection. Is it possible? How? Thanks

edit retag flag offensive close merge delete


For that particular error you can work around it by either making sure that file is available locally (and updating the URL to it in your grade script), or by copy/pasting the contents of that file into your own Gradle script (essentially replacing the include. Not recommended).

gvdhoorn gravatar image gvdhoorn  ( 2016-02-15 07:04:06 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-02-23 05:09:36 -0500

Manuel gravatar image

updated 2016-02-23 05:13:42 -0500

Thanks. That gave me an idea: always try to download URL, but keep a copy just in case. In build.gradle I changed this:

buildscript { 
  apply from: ""  

To this:

buildscript {
    def f = new File("buildscript.gradle") 
    new URL("").withInputStream{ i -> f.withOutputStream{ it << i }}    
    } catch (all) { 
      //do nothing, keep cached script 
    apply from: "buildscript.gradle"  

So I keep a local copy, but if available, downloads from internet.

edit flag offensive delete link more

Question Tools


Asked: 2016-02-15 03:27:25 -0500

Seen: 539 times

Last updated: Feb 23 '16