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

Add a skipPom parameter, skipping a project if packaging is pom #1388

Merged
merged 1 commit into from Mar 7, 2021

Conversation

rolaca11
Copy link

@rolaca11 rolaca11 commented Oct 8, 2020

The usecase for this feature:

There are multiple projects which use the same docker-maven-plugin configuration. A logical way to extract that config to one place is to use the pluginManagement tag.

However, this leaves the need to define the plugin in every project wanting to use that configuration.

A ready solution is to define the plugin in the parent pom, but than the build will fail, because the docker build goal cannot find the packaged jar archive.

Here comes this PR, which tells the docker build goal to skip if the currently built project is a pom.

@codecov
Copy link

codecov bot commented Oct 8, 2020

Codecov Report

Merging #1388 (996683c) into master (0951e51) will increase coverage by 0.56%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##             master    #1388      +/-   ##
============================================
+ Coverage     58.23%   58.79%   +0.56%     
- Complexity     1955     1974      +19     
============================================
  Files           162      162              
  Lines          9014     9014              
  Branches       1362     1362              
============================================
+ Hits           5249     5300      +51     
+ Misses         3295     3229      -66     
- Partials        470      485      +15     
Impacted Files Coverage Δ Complexity Δ
...c/main/java/io/fabric8/maven/docker/BuildMojo.java 32.09% <0.00%> (+32.09%) 12.00 <0.00> (+12.00)
.../io/fabric8/maven/docker/service/BuildService.java 53.15% <0.00%> (+1.80%) 26.00% <0.00%> (ø%)
.../fabric8/maven/docker/service/RegistryService.java 88.46% <0.00%> (+2.56%) 15.00% <0.00%> (ø%)
...ain/java/io/fabric8/maven/docker/util/EnvUtil.java 74.84% <0.00%> (+3.14%) 53.00% <0.00%> (+1.00%)
...va/io/fabric8/maven/docker/AbstractDockerMojo.java 16.81% <0.00%> (+6.19%) 11.00% <0.00%> (+3.00%)
...fabric8/maven/docker/AbstractBuildSupportMojo.java 100.00% <0.00%> (+100.00%) 3.00% <0.00%> (+3.00%)

@sonarcloud
Copy link

sonarcloud bot commented Oct 10, 2020

SonarCloud Quality Gate failed.

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

57.1% 57.1% Coverage
0.0% 0.0% Duplication

@rolaca11 rolaca11 marked this pull request as draft October 22, 2020 12:16
@rolaca11 rolaca11 marked this pull request as ready for review October 22, 2020 12:16
@@ -137,6 +137,9 @@ By default a progress meter is printed out on the console, which is omitted when
| If set dont push any images even when `{plugin}:push` is called.
| `docker.skip.push`

| *skipPom*
| If set to `true` this plugin will skip every projects, where `project.packaging` is set to `true`. Property: `docker.skip.pom`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a typo here:

Suggested change
| If set to `true` this plugin will skip every projects, where `project.packaging` is set to `true`. Property: `docker.skip.pom`
| If set to `true` this plugin will skip every projects, where `project.packaging` is set to `pom`. Property: `docker.skip.pom`

Signed-off-by: Laszlo Stahorszki <laszlo.stahorszki@ropi.dev>
@rohanKanojia
Copy link
Member

@rolaca11: Thanks a lot for this 👍

@rohanKanojia rohanKanojia merged commit 9f729e2 into fabric8io:master Mar 7, 2021
@@ -137,6 +137,9 @@ By default a progress meter is printed out on the console, which is omitted when
| If set dont push any images even when `{plugin}:push` is called.
| `docker.skip.push`

| *skipPom*
| If set to `true` this plugin will skip every projects, where `project.packaging` is set to `pom`. Property: `docker.skip.pom`
Copy link
Contributor

@mabrarov mabrarov Mar 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change breaks the table:

broken-screenshot

There should be 3 columns in each row:

| *skipPom*
| If set to `true` this plugin will skip every projects, where `project.packaging` is set to `pom`.
| `docker.skip.pom`

fixed-screenshot

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mabrarov: Thanks a lot for noticing, Could you please create a PR to fix this ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is it #1448

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've merged it into master. Thanks a lot for your quick 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.

None yet

3 participants