You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jigarjm <ji...@gmail.com> on 2013/08/09 01:31:41 UTC

conditional plugin execution

I am skipping clean phase in CI loop, I want it to execute clean once a day

existing option: 

1. fork clean plugin and modify code to take timespan as conf input and
clean if its building during that time

2. configure maven compiler plugin to mark staleTimemillis to one day, that
will cache classes without modification for a day

Is there any better option ?



--
View this message in context: http://maven.40175.n5.nabble.com/conditional-plugin-execution-tp5767111.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: conditional plugin execution

Posted by Baptiste MATHUS <ml...@batmat.net>.
Hi,

What are you actually trying to achieve?

IIUC, I think it's more a job for the CI server. For example, if you're
using Jenkins, you could use that one
https://wiki.jenkins-ci.org/display/JENKINS/Workspace+Cleanup+Plugin (we do
it to remove "target" directories at the end of the build).

Cheers
Le 9 août 2013 05:36, "jigarjm" <ji...@gmail.com> a écrit :

> that would not operate on same build server workspace
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/conditional-plugin-execution-tp5767111p5767118.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: conditional plugin execution

Posted by jigarjm <ji...@gmail.com>.
that would not operate on same build server workspace 



--
View this message in context: http://maven.40175.n5.nabble.com/conditional-plugin-execution-tp5767111p5767118.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: conditional plugin execution

Posted by jigarjm <ji...@gmail.com>.
Cool, that sounds like a polished hack

Thanks



--
View this message in context: http://maven.40175.n5.nabble.com/conditional-plugin-execution-tp5767111p5767219.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: conditional plugin execution

Posted by Stephen Connolly <st...@gmail.com>.
https://maven.apache.org/plugins/maven-clean-plugin/clean-mojo.html#skip is
the key to get you out of your hole.

You write a custom plugin that just sets the property `clean.skip` to true
if the classes are new enough... a simple plugin to write.

Then bind that plugin to the pre-clean phase of your pom (in a profile that
is only activated by the CI system)

and as you are invoking the `clean` phase and not the `clean:clean` mojo
directly, the pre-clean phase will run first, the property will get set,
and bob's a male sibling of one of your parents!


On 9 August 2013 00:31, jigarjm <ji...@gmail.com> wrote:

> I am skipping clean phase in CI loop, I want it to execute clean once a day
>
> existing option:
>
> 1. fork clean plugin and modify code to take timespan as conf input and
> clean if its building during that time
>
> 2. configure maven compiler plugin to mark staleTimemillis to one day, that
> will cache classes without modification for a day
>
> Is there any better option ?
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/conditional-plugin-execution-tp5767111.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: conditional plugin execution

Posted by Wayne Fay <wa...@gmail.com>.
> I am skipping clean phase in CI loop, I want it to execute clean once a day
...
> Is there any better option ?

Why not simply add another job to your CI server which just runs "mvn
clean" once a day?

Wayne

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


Re: conditional plugin execution

Posted by jigarjm <ji...@gmail.com>.
@andres yes it is more of CI management tool thing, but I wish we had an
option in maven clean plugin to clean optionally if the compiled stuff are
older than threshold (configurable) milllis


Agree It is more CI thing, I am using bamboo and don't have an option to do
it in clean way (that I know of)

Thanks!



--
View this message in context: http://maven.40175.n5.nabble.com/conditional-plugin-execution-tp5767111p5767126.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: conditional plugin execution

Posted by Anders Hammar <an...@hammar.net>.
You could also bring this question to the users list of the CI you're
using. It's rather a question for that list.

/Anders


On Fri, Aug 9, 2013 at 1:31 AM, jigarjm <ji...@gmail.com> wrote:

> I am skipping clean phase in CI loop, I want it to execute clean once a day
>
> existing option:
>
> 1. fork clean plugin and modify code to take timespan as conf input and
> clean if its building during that time
>
> 2. configure maven compiler plugin to mark staleTimemillis to one day, that
> will cache classes without modification for a day
>
> Is there any better option ?
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/conditional-plugin-execution-tp5767111.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
>
>