GoogleContainerTools / GoogleContainerTools/jib

Add support to read from `configuration.outputDirectory` parameter in the spring-boot-maven-plugin

Open
#3,356 7 comments 1 reaction 0 assignees View on GitHub
priority:p3 type: feature request
Dominant language
Java
Stars
14.5k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

**Environment**:

- *Jib version:* 3.1.2
- *Build tool:* Maven 3.6.3
- *OS:* mac OS 10.15.7(19H2)

**Description of the issue**:

When I build(or dockerBuild) with below configuration shows up this error message.
`Obtaining project build output files failed; make sure you have packaged your project before trying to build the image. (Did you accidentally run "mvn clean jib:build" instead of "mvn clean package jib:build"?)`

```

org.springframework.boot
spring-boot-maven-plugin
2.3.2.RELEASE

lib

```

```
$ mvn clean package jib:dockerBuild
...
Caused by: java.io.IOException: Obtaining project build output files failed; make sure you have packaged your project before trying to build the image. (Did you accidentally run "mvn clean jib:build" instead of "mvn clean package jib:build"?)
...
Caused by: java.nio.file.NoSuchFileException: /path/to/my-project/target/my-application.jar.original
```

Build success when remove `configuration.outputDirectory`.
It seems not read outputDirectory configuration if `spring-boot-maven-plugin` is used.
(I guessed by looking at [this code](https://github.com/GoogleContainerTools/jib/blob/cff014ea566eec0474727bc6c344ad5a92fb9123/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenProjectProperties.java#L545).)

Is it intended behavior?

**Expected behavior**:
Build success when using `outputDirectory` in `spring-boot-maven-plugin`

**Steps to reproduce**:

1. use spring-boot-maven-plugin
2. set `outputDirectory`
3. `mvn clean package jib:dockerBuild`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.