0

I am using the latest version of the cxf-xjc-plugin (https://cxf.apache.org/cxf-xjc-plugin.html) plugin, 3.1.0. This plugin generates Java classes for the given xsd files successfully. When I run a clean on the project, the target/generated-sources/java folder is left in place. I've simplified my POM to only use this plugin and the problem persists.

Older versions of the plugin do not do this as don't other similar plugins like jaxb2-maven-plugin.

I have looked at the projects POM and I don't see the clean plugin being configured to protect these files. What else could be going on to cause this?

Half_Duplex
  • 5,102
  • 5
  • 42
  • 58
  • Your question title and description seem to contradiction each other. Your title suggests that you are looking to prevent certain folders from being removed during a clean, while your description seems to ponder why certain folders are not removed. When referring to `clean` are you referring to `mvn clean` or your IDE's clean (e.g. Eclipse: Project->Clean...)? The former should clear out everything under `target`, while the latter will only clean build artifacts, but may leave folders in place. – Frelling Jan 11 '17 at 19:14
  • Ignore my comment regarding contradictions. I just noticed that someone else edited your title causing the confusion. Your original title is to the point. – Frelling Jan 11 '17 at 19:21
  • Yes, the title was poorly edited, I've corrected it. I am using my IDE (Exclipse) to initiated a mvn clean. – Half_Duplex Jan 11 '17 at 19:27
  • I forgot to ask. Are the generated files removed? If not, then it would indicate a change in `project.build.directory` or others that [Maven Clean](https://maven.apache.org/plugins/maven-clean-plugin/) usually checks. Then again it could be `cxf-xjc-plugin` itself. A quick test would be to manually delete `target`, refresh the project and execute a `mvn clean` to see what happens. – Frelling Jan 11 '17 at 19:55
  • The generated classes are not removed. I will test your suggestion. – Half_Duplex Jan 11 '17 at 19:58

1 Answers1

0

What OS are you using? Could it be a permission issue where you built as root outside the ide once? I also saw this Why doesn't Maven's mvn clean ever work the first time?

Community
  • 1
  • 1
Kevin
  • 45
  • 7
  • I'm using Windows 7. Note that previous versions of the plugin as well as similar plugins do not do this. I can reproduce very easily but switching versions back and forth. I believe it's a configuration within the version I am just not knowledgeable enough with Maven to diagnose it. – Half_Duplex Jan 11 '17 at 19:56