Erro ao executar Maven...Caused by: java.lang.ClassNotFoundException: Xmx512m

4 respostas
P

Olá,

estou a executar o comando abaixo me apresentou esse erro ??

O que pode ser ???

Estouusando Windows 7 (64 bits),java 1.6.025,maven 2.2.1.

abs

C:\>mvn archetype:generate \ -DarchetypeGroupId=br.gov.frameworkdemoiselle.arche
types \ -DarchetypeArtifactId=demoiselle-jsf-jpa \ -DarchetypeVersion=2.0.0 \ -D
archetypeRepository=http://demoiselle.sourceforge.net/repository/release/ \ -Dgr
oupId=br.gov.frameworkdemoiselle.sample \ -DartifactId=bookmark \ -Dversion=1.0.
0-SNAPSHOT \ -DinteractiveMode=false
Exception in thread "main" java.lang.NoClassDefFoundError: Xmx512m
Caused by: java.lang.ClassNotFoundException: Xmx512m
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: Xmx512m.  Program will exit.
C:\>

4 Respostas

P

o erro anterior estava faltando as variaveis de ambiente

MAVEN_OPTS=?-Xmx512m?
MAVEN_HOME=/opt/apache_foundation/apache-maven-2.0.9

mais agora está me dando esse erro ::::alguém pode me ajudar ???

C:\>mvn archetype:generate \ -DarchetypeGroupId=br.gov.frameworkdemoiselle.arche
types \-DarchetypeArtifactId=demoiselle-jsf-jpa \-DarchetypeVersion=2.0.0 \-Darc
hetypeRepository=http://demoiselle.sourceforge.net/repository/release/ \-DgroupI
d=br.gov.frameworkdemoiselle.sample \-DartifactId=bookmark \-Dversion=1.0.0-SNAP
SHOT \-DinteractiveMode=false
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Invalid task '\': you must specify a valid lifecycle phase, or a goal in
the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Wed Mar 09 11:38:47 BRT 2011
[INFO] Final Memory: 3M/45M
[INFO] ------------------------------------------------------------------------
C:\>
P
C:\>mvn archetype:generate \ -DarchetypeGroupId=br.gov.frameworkdemoiselle.arche
types \-DarchetypeArtifactId=demoiselle-jsf-jpa \-DarchetypeVersion=2.0.0 \-Darc
hetypeRepository=http://demoiselle.sourceforge.net/repository/release/ \-DgroupI
d=br.gov.frameworkdemoiselle.sample \-DartifactId=bookmark \-Dversion=1.0.0-SNAP
SHOT \-DinteractiveMode=false
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Invalid task '\': you must specify a valid lifecycle phase, or a goal in
the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Wed Mar 09 11:38:47 BRT 2011
[INFO] Final Memory: 3M/45M
[INFO] ------------------------------------------------------------------------
C:\>mvn archetype:generate \ -DarchetypeGroupId=br.gov.frameworkdemoiselle.arche
types \-DarchetypeArtifactId=demoiselle-jsf-jpa \-DarchetypeVersion=2.0.0 \-Darc
hetypeRepository=http://demoiselle.sourceforge.net/repository/release/ \-DgroupI
d=br.gov.frameworkdemoiselle.sample \-DartifactId=bookmark \-Dversion=1.0.0-SNAP
SHOT \-DinteractiveMode=false
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Invalid task '\': you must specify a valid lifecycle phase, or a goal in
the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Wed Mar 09 11:43:43 BRT 2011
[INFO] Final Memory: 3M/56M
[INFO] ------------------------------------------------------------------------
C:\>
C:\>
C:\>
C:\>
C:\>mvn archetype:generate \ -DarchetypeGroupId=br.gov.frameworkdemoiselle.arche
types \-DarchetypeArtifactId=demoiselle-jsf-jpa \-DarchetypeVersion=2.0.0 \-Darc
hetypeRepository=http://demoiselle.sourceforge.net/repository/release/ \-DgroupI
d=br.gov.frameworkdemoiselle.sample \-DartifactId=bookmark \-Dversion=1.0.0-SNAP
SHOT \-DinteractiveMode=false
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[INFO] org.codehaus.mojo: checking for updates from central
[INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for up
dates from central
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archet
ype-plugin/2.0/maven-archetype-plugin-2.0.pom

Downloading: http://repo1.maven.org/maven2/org/apache/maven/archetype/maven-arch
etype/2.0/maven-archetype-2.0.pom

Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-parent/16/mave
n-parent-16.pom

Downloading: http://repo1.maven.org/maven2/org/apache/apache/7/apache-7.pom

Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archet
ype-plugin/2.0/maven-archetype-plugin-2.0.jar

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Invalid task '\': you must specify a valid lifecycle phase, or a goal in
the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34 seconds
[INFO] Finished at: Wed Mar 09 11:45:51 BRT 2011
[INFO] Final Memory: 3M/56M
[INFO] ------------------------------------------------------------------------
C:\>mvn archetype:generate \ -DarchetypeGroupId=br.gov.frameworkdemoiselle.arche
types \-DarchetypeArtifactId=demoiselle-jsf-jpa \-DarchetypeVersion=2.0.0 \-Darc
hetypeRepository=http://demoiselle.sourceforge.net/repository/release/ \-DgroupI
d=br.gov.frameworkdemoiselle.sample \-DartifactId=bookmark \-Dversion=1.0.0-SNAP
SHOT \-DinteractiveMode=false
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[INFO] org.codehaus.mojo: checking for updates from central
[INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for up
dates from central
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archet
ype-plugin/2.0/maven-archetype-plugin-2.0.pom

Downloading: http://repo1.maven.org/maven2/org/apache/maven/archetype/maven-arch
etype/2.0/maven-archetype-2.0.pom

Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-parent/16/mave
n-parent-16.pom

Downloading: http://repo1.maven.org/maven2/org/apache/apache/7/apache-7.pom

Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archet
ype-plugin/2.0/maven-archetype-plugin-2.0.jar

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Invalid task '\': you must specify a valid lifecycle phase, or a goal in
the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 42 seconds
[INFO] Finished at: Wed Mar 09 11:52:17 BRT 2011
[INFO] Final Memory: 2M/45M
[INFO] ------------------------------------------------------------------------
C:\>
P
C:\>mvn -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO]

You must specify at least one goal or lifecycle phase to perform build steps.
The following list illustrates some commonly used build commands:

  mvn clean
    Deletes any build output (e.g. class files or JARs).
  mvn test
    Runs the unit tests for the project.
  mvn install
    Copies the project artifacts into your local repository.
  mvn deploy
    Copies the project artifacts into the remote repository.
  mvn site
    Creates project documentation (e.g. reports or Javadoc).

Please see
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
for a complete description of available lifecycle phases.

Use "mvn --help" to show general usage information about Maven's command line.


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException:

You must specify at least one goal or lifecycle phase to perform build steps.
The following list illustrates some commonly used build commands:

  mvn clean
    Deletes any build output (e.g. class files or JARs).
  mvn test
    Runs the unit tests for the project.
  mvn install
    Copies the project artifacts into your local repository.
  mvn deploy
    Copies the project artifacts into the remote repository.
  mvn site
    Creates project documentation (e.g. reports or Javadoc).

Please see
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
for a complete description of available lifecycle phases.

Use "mvn --help" to show general usage information about Maven's command line.


        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:172)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:6
0)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Wed Mar 09 12:00:48 BRT 2011
[INFO] Final Memory: 2M/56M
[INFO] ------------------------------------------------------------------------
C:\>
P

agora com a opção de erro rodando :

C:\>mvn -e archetype:generate \ -DarchetypeGroupId=br.gov.frameworkdemoiselle.ar
chetypes \-DarchetypeArtifactId=demoiselle-jsf-jpa \-DarchetypeVersion=2.0.0 \-D
archetypeRepository=http://demoiselle.sourceforge.net/repository/release/ \-Dgro
upId=br.gov.frameworkdemoiselle.sample \-DartifactId=bookmark \-Dversion=1.0.0-S
NAPSHOT \-DinteractiveMode=false
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Invalid task '\': you must specify a valid lifecycle phase, or a goal in
the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Invalid task '\': you must specify a val
id lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginA
rtifactId:pluginVersion:goal
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor
(DefaultLifecycleExecutor.java:1830)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListBy
AggregationNeeds(DefaultLifecycleExecutor.java:462)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:175)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:6
0)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4 seconds
[INFO] Finished at: Wed Mar 09 12:05:35 BRT 2011
[INFO] Final Memory: 3M/56M
[INFO] ------------------------------------------------------------------------
C:\>
Criado 9 de março de 2011
Ultima resposta 9 de mar. de 2011
Respostas 4
Participantes 1