Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Re)enable building netbeans offline #2417

Merged
merged 3 commits into from Oct 5, 2020

Conversation

matthiasblaesing
Copy link
Contributor

This PR reestablishes the possibility to build netbeans offline. Offline in this case means, that thirdparty dependencies can be downloaded once and after that is done, the build can be done without a network connection.

This is the sequence:

  1. Change into the netbeans source directory
  2. Download release properties: wget -O ../netbeansrelease.json "https://gitbox.apache.org/repos/asf?p=netbeans-jenkins-lib.git;a=blob_plain;f=meta/netbeansrelease.json"
  3. Download external binaries: ant download-all-extbins
  4. Run the build: ant -Dmetabuild.jsonurl=file:../netbeansrelease.json

Steps 1+2 need an internet connection, step 3 can be run offline.

@matthiasblaesing
Copy link
Contributor Author

The intention of this PR is to ensure netbeans can be build without requiring a constant connection.

@ehsavoie: The javaee parts were problematic because some of the XSDs imported external XSDs from internet servers. In all cases either the requires XSDs were already in the source base and just needed to be moved to the right place or absolute URLs had to replaced with relative paths.

@lkishalmi Another problem was the building of the gradle tooling - I tested building it with the "--offline" option and that works. Do you see a problem here?

@jtulach is this what you meant in your email? Could you please give it a spin?

@lkishalmi
Copy link
Contributor

--offline should be fine as far as I could check. Once the external binaries are downloaded everything would be locally resolvable.

@neilcsmith-net
Copy link
Member

neilcsmith-net commented Oct 5, 2020

Requested review from Eric. I'm dubious about the instructions. Would have thought mirroring how the source release handles this might be better? eg. netbeansrelease.properties in nbbuild/ If existence of that file doesn't stop request for the release json (haven't checked that yet) that sounds like an error that needs fixing anyway?!

EDIT : removed -1 because it's the instructions in the description, not the commits, that may need addressing.

@ebarboni
Copy link
Contributor

ebarboni commented Oct 5, 2020

Hi @matthiasblaesing
maybe we could add a step to download-all-extbins to download the json file in correct place to avoid the wget phase.
AFAIK download-all-extbins is not used in "standard build".

It make me think that step 3 -D parameters is a hack as json file should be detected and used.

Maybe the following code on build.xml in nbbuild line 112 can avoid all the json mess.

 <!-- get all json info we have on apache gitbox  -->
    <property name="metabuild.releasejson" value="${nb_all}/nbbuild/build/netbeansrelease.json"/>
    <condition property="metabuild.jsonurl" value="https://gitbox.apache.org/repos/asf?p=netbeans-jenkins-lib.git;a=blob_plain;f=meta/netbeansrelease.json">
        <not>
            <isset property="metabuild.jsonurl"/>
        </not>
    </condition>
    <condition property="needjson">
        <not>
            <available file="${metabuild.releasejson}" />
        </not>
    </condition>
    <sequential if:set="needjson" >
        <configureproxy connectTo="${metabuild.jsonurl}" hostProperty="proxyHost" portProperty="proxyPort"/>
        <setproxy proxyhost="${proxyHost}" proxyPort="${proxyPort}"/>
        <get dest="${metabuild.releasejson}" skipexisting="false" src="${metabuild.jsonurl}" />     
    </sequential>
    <!-- read info from gitinfo.properties , if present in source bundle copy gitinfo-->

EDIT to add the xml code

@matthiasblaesing
Copy link
Contributor Author

@neilcsmith-net @ebarboni my target was enabling build offline - the procedure was just to show, that it can be successfully done, without to much fuzz. You can broaden the scope, but it was not intended to be.

The approach to download the json file to some "build" directory will not work. ant clean will clean the build directory and your offline buildability is gone.

@ebarboni
Copy link
Contributor

ebarboni commented Oct 5, 2020

For me this is ok to merge

@matthiasblaesing matthiasblaesing added this to the 12.2 milestone Oct 5, 2020
@matthiasblaesing
Copy link
Contributor Author

Thank you for the review. Let's get this in.

@matthiasblaesing matthiasblaesing merged commit 57105e8 into apache:master Oct 5, 2020
@JaroslavTulach
Copy link

Today I updated to most recent master and my build succeeded (instead of failing in javaee.wildfly module). Very nice surprise. Thank you.

@matthiasblaesing matthiasblaesing deleted the build-offline branch October 4, 2021 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants