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

Resolved breaking of build process during mvn package #118

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Kshitiz-Mhto
Copy link

fixes #34

@fahad-israr
Copy link
Collaborator

fahad-israr commented Feb 12, 2023

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

@maxandersen
Copy link
Member

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
Copy link
Author

@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
Copy link
Member

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

@Kshitiz-Mhto
Copy link
Author

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

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

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.

mvn package fails assuming it is run with -Dnative
3 participants