The point is that if your mojo is invoked from an IDE (i.e. using maven
embedded) then the equivalent of command line properties will only be
available from MavenSession and you mojo will be broken if you use
System.getProperties to get them.

So it's not just better to use MavenSession, but it is the ___only correct
way___

-Stephen

On 21 May 2010 08:38, Sessizlik <cem.koc....@gmail.com> wrote:

>
> Hi Olivier,
>
> It returned same data as System.getProperties() . But I think that this is
> better in terms of maven perspective.
>
> Thanks
>
>
>
> Olivier Lamy wrote:
> >
> > Hi,
> > Try with
> >
> > /**
> >  * The Maven Session Object
> >  *
> >  * @parameter expression="${session}"
> >  * @required
> >  * @readonly
> >  */
> >  protected MavenSession session;
> >
> > session.getExecutionProperties()
> >
> > 2010/5/20 Sessizlik <cem.koc....@gmail.com>:
> >>
> >> Hi,
> >>
> >> How can I access command line properties via a Mojo SubClass.
> >>
> >> Now I had this:
> >>
> >>   /** @parameter default-value="${project}" */
> >>   private MavenProject mavenProject;
> >>
> >>
> >> However when I tried to get properties via mavenProject.getProperties(),
> >> I
> >> can not access command line properties that I passed.
> >>
> >> Any help?
> >>
> >> Thanks
> >>
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/Mojo---Command-Line-Properties-tp28619934p28619934.html
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> >> For additional commands, e-mail: users-h...@maven.apache.org
> >>
> >>
> >
> >
> >
> > --
> > Olivier
> > http://twitter.com/olamy
> > http://fr.linkedin.com/in/olamy
> > http://www.viadeo.com/fr/profile/olivier.lamy7
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/Mojo---Command-Line-Properties-tp28619934p28630618.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

Reply via email to