4

I am using the Exec Maven Plugin to run a java program inside of my maven build. I have a problem when executing this java program using the exec plugin, because it executes with a classpath which contains the project's dependencies, including an xml parser implementation which is not wanted in the executed java program and leads to errors. Setting of the attribute "includeProjectDependencies" to false is not an option, because I need the other dependencies from the project (and don't want to set them explicitly to plugins execution configuration to avoid duplication). Is there a way to exclude it from the classpath when running the program through the exec plugin? I only know how I could exclude the dependency in the project (which is wrong because I need it in the resulting war-file) or how to exclude dependencies of the plugin, but cannot find a way how to exclude the project's dependency when executing the plulgin...

I hope there is a way to achieve what I want and would be very helpful if anybody could give me some advice.

Thnx, Marko

Marko Previsic
  • 1,820
  • 16
  • 30
  • 1
    you can have a section directly under , have you tried repeating the depencies there and using ? – radai Aug 02 '13 at 12:25
  • take a look at this answer maybe can help you[ow-to-exclude-dependency-in-a-maven-plugin][1] [1]: http://stackoverflow.com/questions/6028534/how-to-exclude-dependency-in-a-maven-plugin – ZaoTaoBao Aug 02 '13 at 12:30
  • @radai I know it would fix the problem, but it is not an option, because the list of dependencies is huge and I don't want to duplicate it here (somebody would add a dependency to the project and forget to add it in the section of the plugin)... Can I reference the "current" project in this section to add all dependencies this way and exclude the desired dependency? I know how it could be done by adding another project on top of this one, but it is not an option here and I have to keep it in this one pom.xml... – Marko Previsic Aug 02 '13 at 12:31

1 Answers1

1

There is issue created please follow it.

If you really need it for your development purpose build and use locally

Mr.Pramod Anarase
  • 1,454
  • 2
  • 15
  • 19