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

Plugin does not create baseline file #38

Closed
Jokero opened this issue Jan 21, 2020 · 4 comments
Closed

Plugin does not create baseline file #38

Jokero opened this issue Jan 21, 2020 · 4 comments
Assignees

Comments

@Jokero
Copy link

Jokero commented Jan 21, 2020

Hi

First I generated default config file:

mvn detekt:generate-config

Then I run command to generate baseline file:

mvn detekt:create-baseline -Ddetekt.config=default-detekt-config.yml

Error in output:

[ERROR] Failed to execute goal com.github.ozsie:detekt-maven-plugin:1.1.1:create-baseline (default-cli) on project my-service: Execution default-cli of goal com.github.ozsie:detekt-maven-plugin:1.1.1:create-baseline failed: Build failed with 1131 weighted issues (threshold defined was 10)

Baseline file is not created. Ok, let's try to increase threshold to 1132:

detekt finished in 8194 ms.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.151 s
[INFO] Finished at: 2020-01-21T13:13:56+03:00
[INFO] ------------------------------------------------------------------------

Baseline file is still not created. What am I doing wrong?

I expected that the first run of detekt:create-baseline command will create baseline file with all issues placed in Whitelist section

@Ozsie
Copy link
Owner

Ozsie commented Mar 20, 2020

As far as I can tell, the correct flags are passed on to Detekt CLI. Can you verify that it works if you try the CLI directly?

@Ozsie
Copy link
Owner

Ozsie commented Mar 23, 2020

After some more investigations, try this to generate your baseline
mvn detekt:create-baseline -Ddetekt.config=default-detekt-config.yml -Ddetelt.baseline=baseline.xml
It seems that Detekt will not generate the baseline.xml file unless you specify it.

@Ozsie
Copy link
Owner

Ozsie commented Mar 23, 2020

I will try to add that flag as default if it is not present.

@Ozsie Ozsie self-assigned this Mar 23, 2020
Ozsie added a commit that referenced this issue Mar 23, 2020
@Ozsie
Copy link
Owner

Ozsie commented Mar 23, 2020

So, version 1.7.0 is released, it should be visible in Maven Central soon, if you leave -Ddetekt.baseline=baseline.xml out from the call, it will create baseline.xml for you.

@Ozsie Ozsie closed this as completed Mar 23, 2020
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

No branches or pull requests

2 participants