Re: mvn exec:java is giving error

2014-05-23 Thread alexiamarthoon
To stop making avoidable mistakes in project management one can also try
attending good  PMP classes    conducted by any of
the PMI registered REP's for gainig expertise best processes of project
management. Any good  PMP prep course    will
provide students with lots of actionable insights in project management
along with preparing them for PMP certification.



--
View this message in context: 
http://maven.40175.n5.nabble.com/mvn-exec-java-is-giving-error-tp109006p5793780.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



Re: mvn exec:java is giving error

2008-07-29 Thread Magne Nordtveit
On Tuesday 29 July 2008 02:24:10 Abhishek Sanoujam wrote:
---8<---
> $ mvn exec:java -Dexec.mainClass=simpleproject.App
---8<---
> plugin 'org.apache.maven.plugins:maven-exec-plugin' does not

Maven looks for org.apache.maven.plugins: if you don't specify a groupid for 
the plugin you want to execute.

---8<---
> $ mvn org.codehaus.mojo:exec-maven-plugin:1.1:java
> -Dexec.mainClass=simpleproject.App
>
> The above works.
---8<---

You need to add a plugin group to your settings.xml file. Go to your 
~/.m2/settings.xml and add the following there:


org.codehaus.mojo


This tells Maven to look at org.codehaus.mojo: for plugins aswell.

Regards,
Magne

-- 
Magne Nordtveit <[EMAIL PROTECTED]>
Systems Engineer
Offshore Simulator Centre AS
http://www.offsimcentre.no


signature.asc
Description: This is a digitally signed message part.


Re: mvn exec:java is giving error

2008-07-29 Thread Abhishek Sanoujam
Thanks for trying it out Manuel. But I am still getting error trying to 
use exec:java


Here is the stack trace that I get when running with mvn -e:

$ mvn -e clean compile exec:java -Dexec.mainClass=simpleproject.App
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'exec'.
[INFO] 


[ERROR] BUILD ERROR
[INFO] 

[INFO] The plugin 'org.apache.maven.plugins:maven-exec-plugin' does not 
exist or no valid version could be found
[INFO] 


[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: The plugin 
'org.apache.maven.plugins:maven-exec-plugin' does not exist or no valid 
version could be found
   at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1303)
   at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1542)
   at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:405)
   at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:137)

   at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
   at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
   at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
   at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
   at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
   at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: 
org.apache.maven.plugin.version.PluginVersionNotFoundException: The 
plugin 'org.apache.maven.plugins:maven-exec-plugin' does not exist or no 
valid version could be found
   at 
org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:229)
   at 
org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:91)
   at 
org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:171)
   at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1274)

   ... 14 more
[INFO] 


[INFO] Total time: < 1 second
[INFO] Finished at: Tue Jul 29 13:52:45 IST 2008
[INFO] Final Memory: 1M/2M
[INFO] 




Does it have anything to do with MacOS ? Or any settings in maven 
installation? I didn't change anything on the maven installation though, 
using the default one.


Thanks,
Abhishek


Manuel EVENO wrote:

I've done the same test you did and it works fine (see attached log file).

Manuel

--
Xebia IT Architects
FR : http://blog.xebia.fr
EN : http://blog.xebia.com


On Tue, Jul 29, 2008 at 2:24 AM, Abhishek Sanoujam 
<[EMAIL PROTECTED] > wrote:


Hi all,

I am new to maven and I was trying to run a simple java program
from maven. But its NOT working and complaining that the plugin
does not exist or no valid version could be found.

Here is the detailed output:

$ mvn exec:java -Dexec.mainClass=simpleproject.App
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'exec'.
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] The plugin 'org.apache.maven.plugins:maven-exec-plugin'
does not exist or no valid version could be found
[INFO]

[INFO] For more information, run Maven with the -e switch
[INFO]

[INFO] Total time: < 1 second
[INFO] Finished at: Tue Jul 29 05:45:32 IST 2008
[INFO] Final Memory: 1M/2M
[INFO]


I created a simple project using:

$ mvn archetype:create -DgroupId=simpleproject
-DartifactId=simpleMavenProject

It contains a default HelloWorld app in simpleproject.App.java
which is what I am trying to run.

NOTE: If I use the full name of the exec-maven plugin, it is working.

Re: mvn exec:java is giving error

2008-07-29 Thread Manuel EVENO
I've done the same test you did and it works fine (see attached log file).

Manuel

--
Xebia IT Architects
FR : http://blog.xebia.fr
EN : http://blog.xebia.com


On Tue, Jul 29, 2008 at 2:24 AM, Abhishek Sanoujam
<[EMAIL PROTECTED]>wrote:

> Hi all,
>
> I am new to maven and I was trying to run a simple java program from maven.
> But its NOT working and complaining that the plugin does not exist or no
> valid version could be found.
>
> Here is the detailed output:
>
> $ mvn exec:java -Dexec.mainClass=simpleproject.App
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'exec'.
> [INFO]
> 
> [ERROR] BUILD ERROR
> [INFO]
> 
> [INFO] The plugin 'org.apache.maven.plugins:maven-exec-plugin' does not
> exist or no valid version could be found
> [INFO]
> 
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> 
> [INFO] Total time: < 1 second
> [INFO] Finished at: Tue Jul 29 05:45:32 IST 2008
> [INFO] Final Memory: 1M/2M
> [INFO]
> 
>
> I created a simple project using:
>
> $ mvn archetype:create -DgroupId=simpleproject
> -DartifactId=simpleMavenProject
>
> It contains a default HelloWorld app in simpleproject.App.java which is
> what I am trying to run.
>
> NOTE: If I use the full name of the exec-maven plugin, it is working.
>
> $ mvn org.codehaus.mojo:exec-maven-plugin:1.1:java
> -Dexec.mainClass=simpleproject.App
>
> The above works.
>
> Any reason why "mvn exec:java -Dexec.mainClass=simpleproject.App" is not
> working???
>
> I am using maven-2.0.9
> $ mvn -version
> Maven version: 2.0.9
> Java version: 1.5.0_13
> OS name: "mac os x" version: "10.5.2" arch: "i386" Family: "unix"
>
> Thanks for the help in advance.
>
> Regards,
> Abhishek
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
C:\Temp>mvn archetype:create -DgroupId=simpleproject 
-DartifactId=simpleMavenProject
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] 
[INFO] Building Maven Default Project
[INFO]task-segment: [archetype:create] (aggregator-style)
[INFO] 
[INFO] Setting property: classpath.resource.loader.class => 
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [archetype:create]
[WARNING] This goal is deprecated. Please use mvn archetype:generate instead
[INFO] Defaulting package to group ID: simpleproject
4K downloaded
[INFO] 

[INFO] Using following parameters for creating OldArchetype: 
maven-archetype-quickstart:RELEASE
[INFO] 

[INFO] Parameter: groupId, Value: simpleproject
[INFO] Parameter: packageName, Value: simpleproject
[INFO] Parameter: basedir, Value: C:\Temp
[INFO] Parameter: package, Value: simpleproject
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: artifactId, Value: simpleMavenProject
[INFO] * End of debug info from resources from generated 
POM ***
[INFO] OldArchetype created in dir: C:\Temp\simpleMavenProject
[INFO] 
[INFO] BUILD SUCCESSFUL
[INFO] 
[INFO] Total time: 15 seconds
[INFO] Finished at: Tue Jul 29 09:54:54 CEST 2008
[INFO] Final Memory: 8M/14M
[INFO] 

C:\Temp>cd simpleMavenProject

C:\Temp\simpleMavenProject>mvn clean compile exec:java 
-Dexec.mainClass=simpleproject.App
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'exec'.
[INFO] 
[INFO] Building simpleMavenProject
[INFO]task-segment: [clean, compile, exec:java]
[INFO] 
[INFO] [clean:clean]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 1 source file to C:\Temp\simpleMavenProject\target\classes
[INFO] Preparing exec:java
[INFO] No goals neede