You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kranthi Kumar <j....@gmail.com> on 2013/10/23 19:12:29 UTC

Maven shade plugin: Retaining origin file timestamps

Hello,

I am currently using maven shade plugin to package a project jar that would
contain some java libraries as well as some clojure libraries. After some
investigation into load time  performance issue, I found that maven shade
plugin default behaviour is to re-write or create the files, which means
new timestamps will be present in jar for all the files. This generally
wouldn't have been a problem if it is just Java files. Clojure compilation
current behaviour is that if two files - one clojure, one java file have
the same timestamp then it would give clojure file priority and would
compile it on the fly. For example, if a.clj and a corresponding a.class is
present with equal timestamps then clojure would think that a.clj is newer
and would compile it. This is causing all the clojure files to be compiled
again and thus causing jar load time to increase.

Is there a workaround to overcome this default behaviour from
maven-shade-plugin ?

Thanks,
Kranthi

Re: Maven shade plugin: Retaining origin file timestamps

Posted by Kranthi Jajula <j....@gmail.com>.
For now, as a work around, I wrote a shell script that after the shading
process rewrites the timestamps of clojure files to sometime in the past. I
am using maven-exec-plugin to run that shell script. 



--
View this message in context: http://maven.40175.n5.nabble.com/Maven-shade-plugin-Retaining-origin-file-timestamps-tp5773664p5773994.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven shade plugin: Retaining origin file timestamps

Posted by Wayne Fay <wa...@gmail.com>.
> We could remove clj files from the jar altogether. However, the problem is we
> don't know if all the clojure dependencies are AOT compiled. So, some of the
> clojure files should be compiled on the fly. The problem is when dynamically
> compiling clojure files whose class files already exist in the jar.

Well, I see this as an opportunity to do that work today. If you just
figure this out now, you will have a short list of files to filter out
during the packaging step.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven shade plugin: Retaining origin file timestamps

Posted by Kranthi Jajula <j....@gmail.com>.
We could remove clj files from the jar altogether. However, the problem is we
don't know if all the clojure dependencies are AOT compiled. So, some of the
clojure files should be compiled on the fly. The problem is when dynamically
compiling clojure files whose class files already exist in the jar. 





--
View this message in context: http://maven.40175.n5.nabble.com/Maven-shade-plugin-Retaining-origin-file-timestamps-tp5773664p5773855.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven shade plugin: Retaining origin file timestamps

Posted by Wayne Fay <wa...@gmail.com>.
> compile it on the fly. For example, if a.clj and a corresponding a.class is
> present with equal timestamps then clojure would think that a.clj is newer
> and would compile it. This is causing all the clojure files to be compiled
> again and thus causing jar load time to increase.

Perhaps just don't include the *.clj files in your final assembly?

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org