Open Kshitiz-Mhto opened 1 year ago
@maxandersen can please you have a look at this once?
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.
@maxandersen @fahad-israr my mistake, i should have explain what i try to acheive through this PR.
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
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.
would it not be simpler to only run the assembly when profile -Dnative is active?
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.
fixes #34