You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Naresh <Na...@adp.com> on 2010/08/16 14:15:18 UTC

Want to Linux Shell command from Maven's pom.xml

Hi Experts

I want to execute linux shell commands from maven's pom.xml. Here I am
pasting a part of pom.xml where i am trying to execute the command.

< plugin>

< groupId>org.codehaus.mojo< /groupId> 

< artifactId>exec-maven-plugin< /artifactId> 

< version>1.1.1< /version> 

< executions>

< execution>

< goals>

< goal>exec< /goal> 

< /goals>

< /execution>

< /executions>

< configuration>

< executable>hostname< /executable> 

< /configuration>

< /plugin>


--------------------------------------------------------------------------------

But the above is not working. Can you please help me out.

-- 
View this message in context: http://maven.40175.n5.nabble.com/Want-to-Linux-Shell-command-from-Maven-s-pom-xml-tp2636616p2636616.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: Want to Linux Shell command from Maven's pom.xml

Posted by Anders Hammar <an...@hammar.net>.
Then it should work. No idea why it doesn't.

But if you only want to execute the plugin directly (not as part of the
build), why don't you just specify the argument on the command line?

/Anders

On Tue, Aug 17, 2010 at 10:59, Naresh <Na...@adp.com> wrote:

>
> Yes I have exec plugin in plugin management section.
>
> Regards
> Naresh
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Want-to-Linux-Shell-command-from-Maven-s-pom-xml-tp2636616p2637870.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: Want to Linux Shell command from Maven's pom.xml

Posted by Naresh <Na...@adp.com>.
Yes I have exec plugin in plugin management section.

Regards
Naresh
-- 
View this message in context: http://maven.40175.n5.nabble.com/Want-to-Linux-Shell-command-from-Maven-s-pom-xml-tp2636616p2637870.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: Want to Linux Shell command from Maven's pom.xml

Posted by Anders Hammar <an...@hammar.net>.
I can't help you until you answer all my questions!

/Anders
On Tue, Aug 17, 2010 at 06:59, Naresh <Na...@adp.com> wrote:

>
> Yes I am executing mvn exec:exec.
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Want-to-Linux-Shell-command-from-Maven-s-pom-xml-tp2636616p2637696.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: Want to Linux Shell command from Maven's pom.xml

Posted by Naresh <Na...@adp.com>.
Yes I am executing mvn exec:exec.
-- 
View this message in context: http://maven.40175.n5.nabble.com/Want-to-Linux-Shell-command-from-Maven-s-pom-xml-tp2636616p2637696.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: Want to Linux Shell command from Maven's pom.xml

Posted by Anders Hammar <an...@hammar.net>.
Are you executing
mvn exec:exec?

And the plugin setup is in the pluginManagement section?

/Anders

On Mon, Aug 16, 2010 at 16:09, Naresh <Na...@adp.com> wrote:

>
> Hi Experts,
>
> I am getting this error
>
> *************************************
>
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] One or more required plugin parameters are invalid/missing for
> 'exec:exec'
>
> [0] Inside the definition for plugin 'exec-maven-plugin' specify the
> following:
>
> <configuration>
>  ...
>  <executable>VALUE</executable>
> </configuration>
>
> -OR-
>
> on the command line, specify: '-Dexec.executable=VALUE'
>
> *************************************************
>
> I am executing exec plugin from one of child modules.
>
>
> Regards
> Naree
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Want-to-Linux-Shell-command-from-Maven-s-pom-xml-tp2636616p2636742.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: Want to Linux Shell command from Maven's pom.xml

Posted by Naresh <Na...@adp.com>.
Hi Experts,

I am getting this error

*************************************

[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] One or more required plugin parameters are invalid/missing for
'exec:exec'

[0] Inside the definition for plugin 'exec-maven-plugin' specify the
following:

<configuration>
  ...
  <executable>VALUE</executable>
</configuration>

-OR-

on the command line, specify: '-Dexec.executable=VALUE'

*************************************************

I am executing exec plugin from one of child modules.


Regards
Naree
-- 
View this message in context: http://maven.40175.n5.nabble.com/Want-to-Linux-Shell-command-from-Maven-s-pom-xml-tp2636616p2636742.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: Want to Linux Shell command from Maven's pom.xml

Posted by Christoph Kutzinski <ku...@gmx.de>.
> Have you tried to specify the full path to the executable?
> Have you looked at the exec-maven-plugin's project page for examples?

So, when it doesn't print any error, how do you determine that it 'doesn't work'?
Doesn't it print any output?

Can you give the maven output?
You're giving pretty little information and it's therefore difficult to help you.

Have you tried to execute a simple shell script of your own?
Have you tried to redirect the output?




-------- Original-Nachricht --------
> Datum: Mon, 16 Aug 2010 06:01:51 -0700 (PDT)
> Von: Naresh <Na...@adp.com>
> An: users@maven.apache.org
> Betreff: Re: Want to Linux Shell command from Maven\'s pom.xml

> 
> Hi Experts,
> 
> I am not getting any error. But the above the code doesnot work. Regarding
> the version i seen it one of the forum and tired it.
> 
> So can you please help me to resolve it.
> 
> Regards
> Naresh
> -- 
> View this message in context:
> http://maven.40175.n5.nabble.com/Want-to-Linux-Shell-command-from-Maven-s-pom-xml-tp2636616p2636666.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
> 

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


Re: Want to Linux Shell command from Maven's pom.xml

Posted by Naresh <Na...@adp.com>.
Hi Experts,

I am not getting any error. But the above the code doesnot work. Regarding
the version i seen it one of the forum and tired it.

So can you please help me to resolve it.

Regards
Naresh
-- 
View this message in context: http://maven.40175.n5.nabble.com/Want-to-Linux-Shell-command-from-Maven-s-pom-xml-tp2636616p2636666.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: Want to Linux Shell command from Maven's pom.xml

Posted by Christoph Kutzinski <ku...@gmx.de>.
Hi,

"is not working" is not very descriptive. What's the concrete error message?
Have you tried to specify the full path to the executable?
Have you looked at the exec-maven-plugin's project page for examples?

BTW: any reason why you're using version 1.1.1? Looks like 1.2 is the current version.


Christoph

-------- Original-Nachricht --------
> Datum: Mon, 16 Aug 2010 05:15:18 -0700 (PDT)
> Von: Naresh <Na...@adp.com>
> An: users@maven.apache.org
> Betreff: Want to Linux Shell command from Maven\'s pom.xml

> 
> Hi Experts
> 
> I want to execute linux shell commands from maven's pom.xml. Here I am
> pasting a part of pom.xml where i am trying to execute the command.
> 
> < plugin>
> 
> < groupId>org.codehaus.mojo< /groupId> 
> 
> < artifactId>exec-maven-plugin< /artifactId> 
> 
> < version>1.1.1< /version> 
> 
> < executions>
> 
> < execution>
> 
> < goals>
> 
> < goal>exec< /goal> 
> 
> < /goals>
> 
> < /execution>
> 
> < /executions>
> 
> < configuration>
> 
> < executable>hostname< /executable> 
> 
> < /configuration>
> 
> < /plugin>
> 
> 
> --------------------------------------------------------------------------------
> 
> But the above is not working. Can you please help me out.
> 
> -- 
> View this message in context:
> http://maven.40175.n5.nabble.com/Want-to-Linux-Shell-command-from-Maven-s-pom-xml-tp2636616p2636616.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
> 

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