Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

classes.timestamp not cleaned when specifying outputDirectory outside Maven's target directory #39

Closed
vdweij opened this Issue Nov 23, 2010 · 4 comments

Comments

Projects
None yet
2 participants

vdweij commented Nov 23, 2010

I need my compiled classes to be located outside Maven's target directory. This can be accomplished by specifying the outputDirectory element within the build section.

During the clean phase this directory is properly cleaned. The classes.timestamp file however ,that resides in the parent of the configured outputDirectory, is left as is. The result is that the plugin assumes there is nothing to compile.

I currently work around this issue by removing this file with the maven-antrun-plugin but hope to see this fixed in a future release

... src/main/webapp/WEB-INF/classes maven-compiler-plugin 2.0.2 1.6 1.6 org.scala-tools maven-scala-plugin scala-compile-first process-resources add-source compile scala-test-compile process-test-resources testCompile maven-antrun-plugin 1.6 clean Cleaning up maven scala plugin timestamp file run ... ...
Owner

davidB commented Nov 24, 2010

I'll see, if I can do something like always put *.timestamp under target.

Side notes :

  1. it's a bad practise to generate code under src/..., the only case I saw was when the generation could only be done by some team member (need tools only available on some desktop).
  2. you don't need to add antrun, just configure clean plugin
    see http://maven.apache.org/plugins/maven-clean-plugin/examples/delete_additional_files.html
Owner

davidB commented Nov 24, 2010

I'm currious, why do you need to generate under src/main/webapp/WEB-INF/classes ?
I suppose you did other changes, else you also have the jar with your classes into your .war (under WEB-INF/lib)

vdweij commented Nov 24, 2010

Thanks for pointing out that the maven-clean-plugin can be used for additional cleanup. I'll change my pom accordingly.

The reason I need the classes generated outside the target directory is due to a limitation of a web framework I am using. I use maven jetty plugin to run the web application without having to package it. The web framework I use is probably not the first one you might think off when you think about scala... it is JSF 2! It only scans certain places for Managed Beans and that is why I cannot (in combination with jetty:run) stick to maven's target directory.

By the way, when packaging I haven't encountered any problems yet. The only extra configuration I use in my pom is to exclude the classes.timestamp file when building the war.

Owner

davidB commented Jan 7, 2013

Reopen if you need

@davidB davidB closed this Jan 7, 2013

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