-
Notifications
You must be signed in to change notification settings - Fork 51
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
Allow to run native:compile
and native:compile-no-fork
from the command-line
#273
Comments
NullPointerException fix graalvm#270
Allow running native:build from the command-line graalvm#273 NullPointerException fix graalvm#270
Allow running native:build from the command-line graalvm#273 (TODO: fix samples) NullPointerException fix graalvm#270 Signed-off-by: Lazar Mitrović <lazar.mitrovic@oracle.com>
Allow running native:build from the command-line graalvm#273 (TODO: fix samples) NullPointerException fix graalvm#270 Rename Mojos (use native:compile from the command line) Signed-off-by: Lazar Mitrović <lazar.mitrovic@oracle.com>
Allow running native:build from the command-line graalvm#273 (TODO: fix samples) NullPointerException fix graalvm#270 Rename Mojos (use native:compile from the command line) Signed-off-by: Lazar Mitrović <lazar.mitrovic@oracle.com>
Allow running native:build from the command-line graalvm#273 NullPointerException fix graalvm#270 Rename Mojos (use native:compile from the command line) Signed-off-by: Lazar Mitrović <lazar.mitrovic@oracle.com>
Fixed by #274, as now we have |
Thanks for the update. Is the change of name last minute? I don't remember seeing this when I reviewed the PR. I can understand why you'd want to avoid the no-fork suffix but artificially changing the name of the goal isn't a good idea IMO. Can we please reconsider adding the build goal as it was in the PR? The arguments for it are that they're doing the same thing and having another goal is strange. Users will wonder what is the difference between build and compile. Finally the no-fork suffix is well known in the Maven community and official plugins make use of it. |
I also think To recap, we suggest to have
This breaking change should be mentioned in the changelog and documented. |
Hey, I added this change a long time ago, I saw that @snicoll commented on this so I thought that he noticed the change. In the current state, my change isn't a breaking one. My reasoning was that we should have the same invocation as in Gradle:
as However, I see your point that having a different verb is nasty. What I want to suggest is a different, but similar solution: mvn native:compile # forking goal
# <goal>compile-no-fork</goal> <!-- a non forking goal -->
# <goal>build</goal> <!-- a non forking goal that is annotated with @Deprecated and outputs a warning--> That way we have the best of both worlds:
|
I think I am ok with this proposal, but let see how we should handle things on testing side in a profile-less fashion. |
-1 on using compile with Maven. I think we need to take a step back and look at what we have irrespective of the limitation or the history as we're pre 1.0. What would be the natural goal that we would pick for this task? Unless we feel that compile isn't a great candidate for Maven. Such term usually refers to what happens to the compile phase. Having a goal called |
@snicoll I understand the rationale, but with I understand that plugins need to adapt to Maven and Gradle specificities, but with @lazar-mitrovic After discussing with Stéphane, I confirm it won't be possible to implement profile-less native testing so let's keep what we have. |
I'd argue that what we are doing in this goal is actually compilation of java code to an executable file. In order to do that we are utilizing our compiler (along with our virtual machine). As a part of our push for more streamlined nomenclature, we've dropped The fact that we need to execute our Mojos in the Yes, we are stretching the definition of phases here, but that is to be expected - Maven is a tool that is built in order to solve a specific problem, and we are trying to make it do something really different. :) As for breaking changes, I agree that we are in IMO, even if I thought that the |
Thanks for the follow-up. If you think that |
Is your feature request related to a problem? Please describe.
It is not possible to run
./mvnw native:build
consistently from the command-line. If you run this goal from a project that you've never built before (i.e.target
does not exist yet), this yield the following:However, if
package
has run before (potentially with outdated source) it will pick the state of the "latest" timepackage
ran. To avoid that from happening, one can run./mvnw package native:build
.Describe the solution you'd like
There is a way to instruct a goal that it has to run a phase first. Core maven plugins use this feature so that invoking the goal alone is all that it takes to produces an accurate result.
Spring Boot uses this feature as well for their buildpack integration (i.e.
./mvnw spring-boot:build-image
will first build the application and then invoke buildpack on the updated repackaged archive).This makes then the goal not really suitable to being added to a lifecycle execution, as package would then run twice. Core plugins implement a
no-fork
goal that does exactly the same thing as the original goal, except it doesn't execute the phase that it needs.Spring Boot would like to provide a
native
profile that configures both our buildpack integration, and our NBT integration so that users can choose the tool they want. They can currently run./mvnw -Pnative spring-boot:build-native
. However./mvnw -Pnative native:build
does not work as expected for the reason explained above.Describe alternatives you've considered
The alternative would be inconsistent command-line options where NBT requires an extra
package
.Additional context
See spring-projects/spring-boot#31770
The text was updated successfully, but these errors were encountered: