You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by eugene <eu...@gmail.com> on 2014/04/02 13:37:38 UTC

Scanning for Projects... before

Is it possible running a maven plugin before "Scanning for projects..." ?




--
View this message in context: http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393.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: Scanning for Projects... before

Posted by eugene <eu...@gmail.com>.
I still attempt the deletion only once, that is already implemented 
inside my plugin and it does not work :(


On 4/2/14, 5:32 PM, Christian Domsch [via Maven] wrote:
> And I think here is the problem. As far as I understand maven, what
> happens with your setup is that maven recognizes the dependency to
> com.test, then you delete it, after that maven treis to use it e.g. in
> the compile step which leads to the error. And the reason is that
> through your setup you call it everytime a project is run in the reactor.
>
> What I meant, is that you create a regular project, through dependency
> mechanisms ensure that it is the very first project to be run (probably
> multiple ways to achieve that) and so the deletion of com.test is only
> attempted once. Every other project afterwards should then try to
> download the plugin because it is not found in the local repo.
>
> Maybe may way is flawed as well, since my idea suggests that each
> project scans the repo uncached.
>
> Christian
>
> On 02.04.2014 16:25, eugene wrote:
>
> > Well.. there are a lot of projects like this.. My plugin is actually
> > inside the maven's super pom from maven-model-builder jar
> > And it gets invoked once per project (even if there are multiple 
> modules)
> >
> > I actually wanted a solution that will not trigger any changes in my 
> poms..
> >
> > On 4/2/14, 5:20 PM, Christian Domsch [via Maven] wrote:
> >> Have you tried creating a dependency for you rproject, that does that
> >> deleting? If I am not mistaken, dependencies should be downloaded (or
> >> attempted to download) for every project in a reactor run. So lets say
> >> your project is P and the newly introduced project is M then it would
> >> look like:
> >>
> >> /-+-M (deletes com.test in any of its goals...)
> >>     |
> >>     +-P has dependency on com.test and M
> >>
> >> Christian
> >>
> >>
> >> On 02.04.2014 16:14, eugene wrote:
> >>
> >>> I could not agree more if only I had a choice :) Thx for the comment
> >>>
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >> 
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790402.html
> >>> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: [hidden email]
> >> </user/SendEmail.jtp?type=node&node=5790403&i=0>
> >>> For additional commands, e-mail: [hidden email]
> >> </user/SendEmail.jtp?type=node&node=5790403&i=1>
> >>
> >>
> >> 
> ------------------------------------------------------------------------
> >> If you reply to this email, your message will be added to the
> >> discussion below:
> >> 
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790403.html
> >>
> >> To unsubscribe from Scanning for Projects... before, click here
> >> <
> >> NAML
> >> 
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>
> >>
> >
> >
> >
> >
> > --
> > View this message in context: 
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790404.html
> > Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the 
> discussion below:
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790405.html 
>
> To unsubscribe from Scanning for Projects... before, click here 
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5790393&code=ZXVnZW4ucmFiaWlAZ21haWwuY29tfDU3OTAzOTN8MTA1NjEzNjg3MA==>.
> NAML 
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>





--
View this message in context: http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790419.html
Sent from the Maven - Users mailing list archive at Nabble.com.

Re: Scanning for Projects... before

Posted by Christian Domsch <ma...@landrus.de>.
And I think here is the problem. As far as I understand maven, what 
happens with your setup is that maven recognizes the dependency to 
com.test, then you delete it, after that maven treis to use it e.g. in 
the compile step which leads to the error. And the reason is that 
through your setup you call it everytime a project is run in the reactor.

What I meant, is that you create a regular project, through dependency 
mechanisms ensure that it is the very first project to be run (probably 
multiple ways to achieve that) and so the deletion of com.test is only 
attempted once. Every other project afterwards should then try to 
download the plugin because it is not found in the local repo.

Maybe may way is flawed as well, since my idea suggests that each 
project scans the repo uncached.

Christian

On 02.04.2014 16:25, eugene wrote:
> Well.. there are a lot of projects like this.. My plugin is actually
> inside the maven's super pom from maven-model-builder jar
> And it gets invoked once per project (even if there are multiple modules)
>
> I actually wanted a solution that will not trigger any changes in my poms..
>
> On 4/2/14, 5:20 PM, Christian Domsch [via Maven] wrote:
>> Have you tried creating a dependency for you rproject, that does that
>> deleting? If I am not mistaken, dependencies should be downloaded (or
>> attempted to download) for every project in a reactor run. So lets say
>> your project is P and the newly introduced project is M then it would
>> look like:
>>
>> /-+-M (deletes com.test in any of its goals...)
>>     |
>>     +-P has dependency on com.test and M
>>
>> Christian
>>
>>
>> On 02.04.2014 16:14, eugene wrote:
>>
>>> I could not agree more if only I had a choice :) Thx for the comment
>>>
>>>
>>>
>>> --
>>> View this message in context:
>> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790402.html
>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>> </user/SendEmail.jtp?type=node&node=5790403&i=0>
>>> For additional commands, e-mail: [hidden email]
>> </user/SendEmail.jtp?type=node&node=5790403&i=1>
>>
>>
>> ------------------------------------------------------------------------
>> If you reply to this email, your message will be added to the
>> discussion below:
>> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790403.html
>>
>> To unsubscribe from Scanning for Projects... before, click here
>> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5790393&code=ZXVnZW4ucmFiaWlAZ21haWwuY29tfDU3OTAzOTN8MTA1NjEzNjg3MA==>.
>> NAML
>> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790404.html
> Sent from the Maven - Users mailing list archive at Nabble.com.


Re: Scanning for Projects... before

Posted by eugene <eu...@gmail.com>.
Well.. there are a lot of projects like this.. My plugin is actually 
inside the maven's super pom from maven-model-builder jar
And it gets invoked once per project (even if there are multiple modules)

I actually wanted a solution that will not trigger any changes in my poms..

On 4/2/14, 5:20 PM, Christian Domsch [via Maven] wrote:
> Have you tried creating a dependency for you rproject, that does that
> deleting? If I am not mistaken, dependencies should be downloaded (or
> attempted to download) for every project in a reactor run. So lets say
> your project is P and the newly introduced project is M then it would
> look like:
>
> /-+-M (deletes com.test in any of its goals...)
>    |
>    +-P has dependency on com.test and M
>
> Christian
>
>
> On 02.04.2014 16:14, eugene wrote:
>
> > I could not agree more if only I had a choice :) Thx for the comment
> >
> >
> >
> > --
> > View this message in context: 
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790402.html
> > Sent from the Maven - Users mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email] 
> </user/SendEmail.jtp?type=node&node=5790403&i=0>
> > For additional commands, e-mail: [hidden email] 
> </user/SendEmail.jtp?type=node&node=5790403&i=1>
> >
>
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the 
> discussion below:
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790403.html 
>
> To unsubscribe from Scanning for Projects... before, click here 
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5790393&code=ZXVnZW4ucmFiaWlAZ21haWwuY29tfDU3OTAzOTN8MTA1NjEzNjg3MA==>.
> NAML 
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>





--
View this message in context: http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790404.html
Sent from the Maven - Users mailing list archive at Nabble.com.

Re: Scanning for Projects... before

Posted by Christian Domsch <ma...@landrus.de>.
Have you tried creating a dependency for you rproject, that does that 
deleting? If I am not mistaken, dependencies should be downloaded (or 
attempted to download) for every project in a reactor run. So lets say 
your project is P and the newly introduced project is M then it would 
look like:

/-+-M (deletes com.test in any of its goals...)
   |
   +-P has dependency on com.test and M

Christian


On 02.04.2014 16:14, eugene wrote:
> I could not agree more if only I had a choice :) Thx for the comment
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790402.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: Scanning for Projects... before

Posted by eugene <eu...@gmail.com>.
I could not agree more if only I had a choice :) Thx for the comment



--
View this message in context: http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790402.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: Scanning for Projects... before

Posted by Christian Domsch <ma...@landrus.de>.
Well, I think maven is the wrong thing to solve this here, since you 
clearly use maven in a non intended way. In a CI setup, that would be a 
build task before the maven task would be called.
Christian
On 02.04.2014 16:09, eugene wrote:
> I want to delete a directory from local repo before building a multi-module
> project.
> I wrote a plugin for that and the directory get deleted indeed, but it gets
> deleted too late.
>
> What I mean: my project "Project" has a dependency "com.test" that is not
> present in local repo. I run mvn clean install. What happens is that maven
> is scanning for projects and all the dependencies that it needs, downloading
> them (I guess though artifact resolver) to my local repo. Then my plugin is
> hooked to the "pre-clean" phase and it removes the directory
> ".m2/repository/com". Now when "Project" actually needs dependency
> "com.test" for the compile, this dependency is not present (my plugin
> removed it) and maven fails.
>
> Why do I have such a weird case? Imagine I have releases artifacts that
> actually do not change their version, but do change their contents. Maven
> will not update my local repo unless their are snapshots, right? Well
> snapshot is not an option right now (due to corporate things).
>
> That is why I first need to remove "com.test" then kick in the artifact
> resolver.
>
> Thank you,
> Eugene.
>
>
>
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790400.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: Scanning for Projects... before

Posted by Baptiste Mathus <bm...@batmat.net>.
You're very likely to send some day an old version of a false releases,
actually a snapshot, to production with this technique.
I guess you should at least send a mail to some managers to explain things
are going to go wrong some day. At least you will have taken your
responsibility and they can't pretend it's your fault.

Also, I hope nobody will ever use a vanilla version of Maven on their dev
box since they're never going to get the rotten new releases downloaded :-/.


2014-04-04 9:06 GMT+02:00 eugene <eu...@gmail.com>:

> Christian, you have no idea how much I wish this were a possibility, but
> this is the way the company has handled things for years.
> Changing this behavior would mean a revolution in their understanding,
> and I sure do not want to start one just yet. :)
>
> There is a much cooler way  to do it actually... since we have Jenkins
> that builds the jobs (way too many to hook a pre-build event on them
> directly), we could implement an Extension Point for the Maven Reporter
> Plugin that has one called PreBuild - the only problem is that it works
> only for Maven 2 from what I tested. I asked their forums about this
> issue, no response so far.
>
> On 4/4/14, 9:59 AM, Christian Domsch [via Maven] wrote:
> > Well that is essentially a *very* basic way of my CI approach :) But it
> > means you have to do it everywhere you have maven installed and need
> > that behaviour. Also has the drawback of injecting this behaviour in any
> > maven runs.
> >
> > So, as mentioned before a few times: switch to some standard use of
> > maven :)
> >
> > On 04.04.2014 08:55, eugene wrote:
> >
> > > I think we have found one...
> > >
> > > We can create a wrapper around MavenCli and replace it in m2.conf...
> > >
> > > On 4/2/14, 8:35 PM, Wayne Fay [via Maven] wrote:
> > >>>> repo unless their are snapshots, right? Well snapshot is not an
> > option
> > >>>> right now (due to corporate things).
> > >>> It is one of Maven's cardinal assumptions that release versions are
> > >>> immutable. If you need different contents, use either: A) a different
> > >> As Curtis already mentioned, you are unlikely to find a solution by
> > >> continuing to head in this direction. Find another approach - most
> > >> likely one that involves a process running outside of Maven before
> > >> your build kicks off.
> > >>
> > >> Wayne
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: [hidden email]
> > >> </user/SendEmail.jtp?type=node&node=5790420&i=0>
> > >> For additional commands, e-mail: [hidden email]
> > >> </user/SendEmail.jtp?type=node&node=5790420&i=1>
> > >>
> > >>
> > >>
> > >>
> > ------------------------------------------------------------------------
> > >> If you reply to this email, your message will be added to the
> > >> discussion below:
> > >>
> >
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790420.html
> > >>
> > >> To unsubscribe from Scanning for Projects... before, click here
> > >> <
> > >> NAML
> > >>
> > <
> http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
> > >>
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> >
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790474.html
> > > Sent from the Maven - Users mailing list archive at Nabble.com.
> >
> >
> >
> > ------------------------------------------------------------------------
> > If you reply to this email, your message will be added to the
> > discussion below:
> >
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790475.html
> >
> > To unsubscribe from Scanning for Projects... before, click here
> > <
> http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5790393&code=ZXVnZW4ucmFiaWlAZ21haWwuY29tfDU3OTAzOTN8MTA1NjEzNjg3MA==
> >.
> > NAML
> > <
> http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790476.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>



-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Re: Scanning for Projects... before

Posted by eugene <eu...@gmail.com>.
Christian, you have no idea how much I wish this were a possibility, but 
this is the way the company has handled things for years.
Changing this behavior would mean a revolution in their understanding, 
and I sure do not want to start one just yet. :)

There is a much cooler way  to do it actually... since we have Jenkins 
that builds the jobs (way too many to hook a pre-build event on them 
directly), we could implement an Extension Point for the Maven Reporter 
Plugin that has one called PreBuild - the only problem is that it works 
only for Maven 2 from what I tested. I asked their forums about this 
issue, no response so far.

On 4/4/14, 9:59 AM, Christian Domsch [via Maven] wrote:
> Well that is essentially a *very* basic way of my CI approach :) But it
> means you have to do it everywhere you have maven installed and need
> that behaviour. Also has the drawback of injecting this behaviour in any
> maven runs.
>
> So, as mentioned before a few times: switch to some standard use of 
> maven :)
>
> On 04.04.2014 08:55, eugene wrote:
>
> > I think we have found one...
> >
> > We can create a wrapper around MavenCli and replace it in m2.conf...
> >
> > On 4/2/14, 8:35 PM, Wayne Fay [via Maven] wrote:
> >>>> repo unless their are snapshots, right? Well snapshot is not an 
> option
> >>>> right now (due to corporate things).
> >>> It is one of Maven's cardinal assumptions that release versions are
> >>> immutable. If you need different contents, use either: A) a different
> >> As Curtis already mentioned, you are unlikely to find a solution by
> >> continuing to head in this direction. Find another approach - most
> >> likely one that involves a process running outside of Maven before
> >> your build kicks off.
> >>
> >> Wayne
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> </user/SendEmail.jtp?type=node&node=5790420&i=0>
> >> For additional commands, e-mail: [hidden email]
> >> </user/SendEmail.jtp?type=node&node=5790420&i=1>
> >>
> >>
> >>
> >> 
> ------------------------------------------------------------------------
> >> If you reply to this email, your message will be added to the
> >> discussion below:
> >> 
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790420.html
> >>
> >> To unsubscribe from Scanning for Projects... before, click here
> >> <
> >> NAML
> >> 
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>
> >>
> >
> >
> >
> >
> > --
> > View this message in context: 
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790474.html
> > Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the 
> discussion below:
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790475.html 
>
> To unsubscribe from Scanning for Projects... before, click here 
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5790393&code=ZXVnZW4ucmFiaWlAZ21haWwuY29tfDU3OTAzOTN8MTA1NjEzNjg3MA==>.
> NAML 
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>





--
View this message in context: http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790476.html
Sent from the Maven - Users mailing list archive at Nabble.com.

Re: Scanning for Projects... before

Posted by Christian Domsch <ma...@landrus.de>.
Well that is essentially a *very* basic way of my CI approach :) But it 
means you have to do it everywhere you have maven installed and need 
that behaviour. Also has the drawback of injecting this behaviour in any 
maven runs.

So, as mentioned before a few times: switch to some standard use of maven :)

On 04.04.2014 08:55, eugene wrote:
> I think we have found one...
>
> We can create a wrapper around MavenCli and replace it in m2.conf...
>
> On 4/2/14, 8:35 PM, Wayne Fay [via Maven] wrote:
>>>> repo unless their are snapshots, right? Well snapshot is not an option
>>>> right now (due to corporate things).
>>> It is one of Maven's cardinal assumptions that release versions are
>>> immutable. If you need different contents, use either: A) a different
>> As Curtis already mentioned, you are unlikely to find a solution by
>> continuing to head in this direction. Find another approach - most
>> likely one that involves a process running outside of Maven before
>> your build kicks off.
>>
>> Wayne
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> </user/SendEmail.jtp?type=node&node=5790420&i=0>
>> For additional commands, e-mail: [hidden email]
>> </user/SendEmail.jtp?type=node&node=5790420&i=1>
>>
>>
>>
>> ------------------------------------------------------------------------
>> If you reply to this email, your message will be added to the
>> discussion below:
>> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790420.html
>>
>> To unsubscribe from Scanning for Projects... before, click here
>> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5790393&code=ZXVnZW4ucmFiaWlAZ21haWwuY29tfDU3OTAzOTN8MTA1NjEzNjg3MA==>.
>> NAML
>> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790474.html
> Sent from the Maven - Users mailing list archive at Nabble.com.


Re: Scanning for Projects... before

Posted by Stephen Connolly <st...@gmail.com>.
There is a *very* hacky way... I hesitate to suggest it... but as you seem
stuck!

Your "delete" mojo can take a wander through the dependency tree and record
the details of all dependencies from the tree that will be affected by the
deleting. You will need to do this for the entire set of reactor projects.
You will need to do this only when you are the first reactor project in the
reactor... for all other projects you will just do a no-op and return
immediately.

Then you do the delete.

Then you request resolution of all the dependencies that were deleted, and
you tell Maven to force the resolution (i.e. ignore the internal state that
says it downloaded them already) There is a flag you can set that will do
the forcing... but as this is an unrecommended HACK, you shall have to find
that flag yourself.

Thus when you mojo is finished executing, Maven's internal state that says
it downloaded these dependencies already will be consistent with the
on-disk state (because the files are present) and all will be right with
the world.

Beware! There be dragons!

Dragon 1: If any of the dependencies you re-download have a different
dependency list... you will be burned

Dragon 2: If any of the dependencies you re-download have a dependency
within the reactor... you will be burned

There are more dragons... and you may find the rug pulled out from under
you if you upgrade Maven...

Beware!


On 4 April 2014 07:55, eugene <eu...@gmail.com> wrote:

> I think we have found one...
>
> We can create a wrapper around MavenCli and replace it in m2.conf...
>
> On 4/2/14, 8:35 PM, Wayne Fay [via Maven] wrote:
> > >> repo unless their are snapshots, right? Well snapshot is not an option
> > >> right now (due to corporate things).
> > >
> > > It is one of Maven's cardinal assumptions that release versions are
> > > immutable. If you need different contents, use either: A) a different
> >
> > As Curtis already mentioned, you are unlikely to find a solution by
> > continuing to head in this direction. Find another approach - most
> > likely one that involves a process running outside of Maven before
> > your build kicks off.
> >
> > Wayne
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > </user/SendEmail.jtp?type=node&node=5790420&i=0>
> > For additional commands, e-mail: [hidden email]
> > </user/SendEmail.jtp?type=node&node=5790420&i=1>
> >
> >
> >
> > ------------------------------------------------------------------------
> > If you reply to this email, your message will be added to the
> > discussion below:
> >
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790420.html
> >
> > To unsubscribe from Scanning for Projects... before, click here
> > <
> http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5790393&code=ZXVnZW4ucmFiaWlAZ21haWwuY29tfDU3OTAzOTN8MTA1NjEzNjg3MA==
> >.
> > NAML
> > <
> http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790474.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>

Re: Scanning for Projects... before

Posted by eugene <eu...@gmail.com>.
I think we have found one...

We can create a wrapper around MavenCli and replace it in m2.conf...

On 4/2/14, 8:35 PM, Wayne Fay [via Maven] wrote:
> >> repo unless their are snapshots, right? Well snapshot is not an option
> >> right now (due to corporate things).
> >
> > It is one of Maven's cardinal assumptions that release versions are
> > immutable. If you need different contents, use either: A) a different
>
> As Curtis already mentioned, you are unlikely to find a solution by
> continuing to head in this direction. Find another approach - most
> likely one that involves a process running outside of Maven before
> your build kicks off.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email] 
> </user/SendEmail.jtp?type=node&node=5790420&i=0>
> For additional commands, e-mail: [hidden email] 
> </user/SendEmail.jtp?type=node&node=5790420&i=1>
>
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the 
> discussion below:
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790420.html 
>
> To unsubscribe from Scanning for Projects... before, click here 
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5790393&code=ZXVnZW4ucmFiaWlAZ21haWwuY29tfDU3OTAzOTN8MTA1NjEzNjg3MA==>.
> NAML 
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>





--
View this message in context: http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790474.html
Sent from the Maven - Users mailing list archive at Nabble.com.

Re: Scanning for Projects... before

Posted by Wayne Fay <wa...@gmail.com>.
>> repo unless their are snapshots, right? Well snapshot is not an option
>> right now (due to corporate things).
>
> It is one of Maven's cardinal assumptions that release versions are
> immutable. If you need different contents, use either: A) a different

As Curtis already mentioned, you are unlikely to find a solution by
continuing to head in this direction. Find another approach - most
likely one that involves a process running outside of Maven before
your build kicks off.

Wayne

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


Re: Scanning for Projects... before

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Eugene,

> Imagine I have releases artifacts that actually do not change their
> version, but do change their contents. Maven will not update my local
> repo unless their are snapshots, right? Well snapshot is not an option
> right now (due to corporate things).

It is one of Maven's cardinal assumptions that release versions are
immutable. If you need different contents, use either: A) a different
version string every time something changes; or B) a SNAPSHOT version. This
mutability is the entire purpose of snapshots, and what differentiates them
from release versions.

Regards,
Curtis


On Wed, Apr 2, 2014 at 9:09 AM, eugene <eu...@gmail.com> wrote:

> I want to delete a directory from local repo before building a multi-module
> project.
> I wrote a plugin for that and the directory get deleted indeed, but it gets
> deleted too late.
>
> What I mean: my project "Project" has a dependency "com.test" that is not
> present in local repo. I run mvn clean install. What happens is that maven
> is scanning for projects and all the dependencies that it needs,
> downloading
> them (I guess though artifact resolver) to my local repo. Then my plugin is
> hooked to the "pre-clean" phase and it removes the directory
> ".m2/repository/com". Now when "Project" actually needs dependency
> "com.test" for the compile, this dependency is not present (my plugin
> removed it) and maven fails.
>
> Why do I have such a weird case? Imagine I have releases artifacts that
> actually do not change their version, but do change their contents. Maven
> will not update my local repo unless their are snapshots, right? Well
> snapshot is not an option right now (due to corporate things).
>
> That is why I first need to remove "com.test" then kick in the artifact
> resolver.
>
> Thank you,
> Eugene.
>
>
>
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790400.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: Scanning for Projects... before

Posted by eugene <eu...@gmail.com>.
I want to delete a directory from local repo before building a multi-module
project. 
I wrote a plugin for that and the directory get deleted indeed, but it gets
deleted too late.

What I mean: my project "Project" has a dependency "com.test" that is not
present in local repo. I run mvn clean install. What happens is that maven
is scanning for projects and all the dependencies that it needs, downloading
them (I guess though artifact resolver) to my local repo. Then my plugin is
hooked to the "pre-clean" phase and it removes the directory
".m2/repository/com". Now when "Project" actually needs dependency
"com.test" for the compile, this dependency is not present (my plugin
removed it) and maven fails.

Why do I have such a weird case? Imagine I have releases artifacts that
actually do not change their version, but do change their contents. Maven
will not update my local repo unless their are snapshots, right? Well
snapshot is not an option right now (due to corporate things).

That is why I first need to remove "com.test" then kick in the artifact
resolver.

Thank you,
Eugene.






--
View this message in context: http://maven.40175.n5.nabble.com/Scanning-for-Projects-before-tp5790393p5790400.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: Scanning for Projects... before

Posted by Wayne Fay <wa...@gmail.com>.
> Is it possible running a maven plugin before "Scanning for projects..." ?

Probably not. What is your use case?

Wayne

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