starfixdev / starfix

Utility to easily open and operator on source code via url links from your browser
Apache License 2.0
26 stars 21 forks source link

Resolved breaking of build process during `mvn package` #118

Open Kshitiz-Mhto opened 1 year ago

Kshitiz-Mhto commented 1 year ago

fixes #34

fahad-israr commented 1 year ago

@maxandersen can please you have a look at this once?

maxandersen commented 1 year ago

Not really following what this is trying todo. Looks like its mutating the assembly script where I would say it should just not get executed unless in the native profile.

Kshitiz-Mhto commented 1 year ago

@maxandersen @fahad-israr my mistake, i should have explain what i try to acheive through this PR.

What i try to achieve:

when we packages the project with mvn package, the assembly descriptor file searches for the native image which was not present initially which was the root cause of error. So i added script that manipulates the assembly descriptor and comments the section just before creating a zip file as per descriptor .

    <files>
        <file>
            <source> ${project.build.directory}/${project.build.finalName}-runner</source>
            <outputDirectory>/installer</outputDirectory>
            <destName>starfix</destName>
        </file>
    </files>

after creating zip file in target, again same script will run to ensure the previous commented section to be uncommented. This action make the descriptor file look as it have never been touched or manipulated. This prevent the breaking of build process during mvn package

In case of building native image using mvn package -Dnative

Firstly, it will create the native image then only bash script will run. Bash script always searches for the native image at first, bash script will get executed if and only if there is no native image available. So bash script will never get execute, while executing this command, the descriptor file will not get manipulated during native build.

maxandersen commented 1 year ago

would it not be simpler to only run the assembly when profile -Dnative is active?

Kshitiz-Mhto commented 1 year ago

would it not be simpler to only run the assembly when profile -Dnative is active?

done :+1: as per your suggestion @maxandersen , thank you. learned a new lot thing about mvn and it ecosystem during this PR.