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

Source file must be provided failure when running spring-boot:repackage from the command-line #22317

Open
jmaasing opened this issue Jul 13, 2020 · 3 comments
Labels
type: enhancement A general enhancement
Milestone

Comments

@jmaasing
Copy link

This is exactly the same as reported #19055

Environment:

mvn -V
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
¨Java version: 14.0.1, vendor: Azul Systems, Inc.,
Default locale: en_SE, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.5", arch: "x86_64", family: "mac"

How to reproduce

Go to https://start.spring.io/
Select Maven, Java, 2.3.1, Jar, Java 14.
Unpack the downloaded zip file and go into the directory:
Type:
mvn clean package

wait for it to finish, then type:
mvn spring-boot:repackage

I get the following error:

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.1.RELEASE:repackage (default-cli) on project demo: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.3.1.RELEASE:repackage failed: Source file must not be null -> [Help 1]

Workaround

Run mvn clean package spring-boot:repackage

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 13, 2020
@wilkinsona
Copy link
Member

wilkinsona commented Jul 13, 2020

Thank you, @jmaasing. Sorry, I see now that this is indeed exactly the same as #19055. I misread things earlier. We have precise steps to reproduce the problem now though (thank you for that) so let's keep this one open as we're better-placed to investigate.

@wilkinsona
Copy link
Member

@jmaasing As @snicoll asked the raiser of #19055 can you please help us to understand your use case for calling the spring-boot:repackage goal in isolation rather than relying upon it being bound to the package phase?

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Jul 13, 2020
@jmaasing
Copy link
Author

For my use case I can bind it to the package phase if needed. The way I ended up testing this is because I have a parent-POM that builds not only the spring boot application but also other things and wanted to add the re-packaging as a separate step in the build pipeline.

I could not find anything in the documentation indicating that this goal can not be run separately. Neither when I do mvn spring-boot:help or on https://docs.spring.io/spring-boot/docs/current/maven-plugin/reference/html/#using

So maybe it's just a case of improving documentation that this goal can not be run from the command line unless you also do package.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jul 13, 2020
@philwebb philwebb added for: team-attention An issue we'd like other members of the team to review type: enhancement A general enhancement and removed for: team-attention An issue we'd like other members of the team to review status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Jul 13, 2020
@philwebb philwebb added this to the 2.4.x milestone Jul 15, 2020
@philwebb philwebb modified the milestones: 2.4.x, 2.x Oct 19, 2020
yum-yab added a commit to yum-yab/archivo-consistency-mod that referenced this issue Nov 18, 2021
Now the repackage step mysteriously works
Source: spring-projects/spring-boot#22317
@philwebb philwebb modified the milestones: 2.x, 3.x Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants