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

Should delete target directory completely for mvn clean if configuration file has debug true enabled #219

Closed
dipak-pawar opened this Issue Oct 10, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@dipak-pawar
Contributor

dipak-pawar commented Oct 10, 2017

Issue Overview

Currently there is no way to maven extension to check which lifecycle of maven user is trying to execute. Due to which extension is trying to install all required dependency/modification of pom.xml even in clean, compile phase.

Now consider this scenario:
You have smart-testing.yml is defined as configuration file which has debug enabled in it

mode: selecting
strategies: new
debug : true

Now if user is trying to execute mvn clean then as per maven convention it should delete target directory.
But as we are purging all the required reports/effective-poms in afterSessionEnd method. It's not deleting target directory because it has purged effective-pom.xml in
smart-testing/smart-testing-effective-pom.xml
This should not be the case for mvn clean

Expected Behaviour

mvn clean should delete target directory completely

Current Behaviour

mvn clean is keeping purged resources in target directory

Steps To Reproduce
  1. Run smart testing using mvn clean test on any project with following content for smart-testing.yml
mode: selecting
strategies: new
debug : true
  1. Again run mvn clean
  2. Look for target directory inside your project & it's content

@dipak-pawar dipak-pawar changed the title from Should delete target directory completely for mvn clean even if configuration file has debug true to Should delete target directory completely for mvn clean if configuration file has debug true enabled Oct 10, 2017

@MatousJobanek MatousJobanek self-assigned this Oct 13, 2017

@MatousJobanek

This comment has been minimized.

Show comment
Hide comment
@MatousJobanek

MatousJobanek Oct 13, 2017

Contributor

There is a way to check the specified goals. Unfortunately, this case is more complicated than just the goals clean and compile. You can run any of the goals that are executed before the test phase and the tests won't be invoked.

Contributor

MatousJobanek commented Oct 13, 2017

There is a way to check the specified goals. Unfortunately, this case is more complicated than just the goals clean and compile. You can run any of the goals that are executed before the test phase and the tests won't be invoked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment