-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
Procfile Buildpack ignored by spring-boot:build-image #26215
Comments
It appears that you are running the The Spring Boot Maven plugin always builds a jar or war file and then sends only the contents of the built archive to the builder. If Procfile is outside of the source tree (for example, Can you verify that your Procfile is not in the built jar or war? |
@scottfrederick no luck to put Procfile in src/main/resources. Any hack way to include Procfile support with spring-boot:build-image? 😃 If I add Procfile into spring-boot25-demo-0.0.1-SNAPSHOT.jar with
I added exec-maven-plugin to add Procfile into repackaged jar, but procfile can not been detected. <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>jar</executable>
<!-- optional -->
<workingDirectory>${project.build.directory}</workingDirectory>
<arguments>
<argument>-uf</argument>
<argument>${project.build.finalName}.jar</argument>
<argument>../Procfile</argument>
</arguments>
</configuration>
</plugin> |
@linux-china I've been looking into some ways to make this work, but I have not come up with a hack using the Spring Boot Maven plugin. The The Maven plugin does not unpack the archive generated by Boot's This is possible with the Spring Boot Gradle plugin, as the Gradle plugin has more flexibility to include files outside of the defined layout. With a typical Gradle project and a Procfile in the root of the project, this configuration in
I'm tagging this issue for team attention so we can discuss whether we can do anything to improve the situation with the Maven plugin. |
#6626 Is related to this. As summarised in this issue by @nebhale, placing things in the root of the jar is problematic as it pollutes the application’s classpath:
|
I want to put some tasks in Procfile file with Spring Boot application, the spring-boot-maven-plugin configuration as following:
Then I create a Procfile with following code:
Then I use
mvn -DskipTests clean package spring-boot:build-image
to build the docker image with following output:Procfile buildpack not detected by the builder.
Then I use command line
pack build spring-boot25-demo:0.0.1-SNAPSHOT
to build the app, and I get following output:And procfile buildpack included by pack CLI.
Any special with
spring-boot:build-image
?The text was updated successfully, but these errors were encountered: