Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to generate a project #8

Open
mcgivrer opened this issue Oct 21, 2013 · 4 comments
Open

Unable to generate a project #8

mcgivrer opened this issue Oct 21, 2013 · 4 comments

Comments

@mcgivrer
Copy link

I've just try the following commande :

frederic@nostromo5:~/Projects/java/myfirstgame$ mvn archetype:generate     -DarchetypeRepository=local     -DarchetypeRepository=$HOME/.m2/repository     -DarchetypeGroupId=com.badlogic.gdx     -DarchetypeArtifactId=gdx-archetype     -DarchetypeVersion=0.9.9-SNAPSHOT

And the input the following parameters :

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Libgdx Project Archetype 0.9.9-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> maven-archetype-plugin:2.0:generate (default-cli) @ gdx-archetype >>>
[INFO] 
[INFO] <<< maven-archetype-plugin:2.0:generate (default-cli) @ gdx-archetype <<<
[INFO] 
[INFO] --- maven-archetype-plugin:2.0:generate (default-cli) @ gdx-archetype ---
[INFO] Generating project in Interactive mode
[INFO] Archetype defined by properties
[WARNING] Could not transfer metadata com.badlogic.gdx:gdx-archetype:0.9.9-SNAPSHOT/maven-metadata.xml from/to gdx-archetype-repo (/home/frederic/.m2/repository): No connector available to access repository gdx-archetype-repo (/home/frederic/.m2/repository) of type default using the available factories WagonRepositoryConnectorFactory
Define value for property 'groupId': : com.mcgivrer.games
Define value for property 'artifactId': : myfirstgame
Define value for property 'version':  1.0-SNAPSHOT: : 
Define value for property 'package':  com.mcgivrer.games: : 
Define value for property 'JavaGameClassName': : MyFirstGame
Confirm properties configuration:
groupId: com.mcgivrer.games
artifactId: myfirstgame
version: 1.0-SNAPSHOT
package: com.mcgivrer.games
JavaGameClassName: MyFirstGame
 Y: : Y

Then, the process crash with the following error :

[ERROR] org.apache.maven.archetype.exception.InvalidPackaging: Unable to add module to the current project as it is not of packaging type 'pom'
org.apache.maven.archetype.exception.ArchetypeGenerationFailure: org.apache.maven.archetype.exception.InvalidPackaging: Unable to add module to the current project as it is not of packaging type 'pom'
    at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.generateArchetype(DefaultFilesetArchetypeGenerator.java:237)
    at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.processFileSetArchetype(DefaultArchetypeGenerator.java:136)
    at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:106)
    at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:149)
    at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:209)
    at org.apache.maven.archetype.DefaultArchetypeManager.generateProjectFromArchetype(DefaultArchetypeManager.java:71)
    at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:190)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.archetype.exception.InvalidPackaging: Unable to add module to the current project as it is not of packaging type 'pom'
    at org.apache.maven.archetype.common.DefaultPomManager.addModule(DefaultPomManager.java:98)
    at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processPomWithParent(DefaultFilesetArchetypeGenerator.java:608)
    at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processFilesetProject(DefaultFilesetArchetypeGenerator.java:553)
    at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processFilesetModule(DefaultFilesetArchetypeGenerator.java:495)
    at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.generateArchetype(DefaultFilesetArchetypeGenerator.java:210)
    ... 27 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.383s
[INFO] Finished at: Mon Oct 21 20:56:00 CEST 2013
[INFO] Final Memory: 9M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.0:generate (default-cli) on project gdx-archetype: org.apache.maven.archetype.exception.InvalidPackaging: Unable to add module to the current project as it is not of packaging type 'pom' -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
frederic@nostromo5:~/Projects/java/libgdx-maven-archetype$ 

What have I done wrong ?

@zergood
Copy link

zergood commented Dec 6, 2013

I have the same problem..
You should leave the directory where you cloned this repo and after that start the maven mvn archetype:generate.

@targeter21
Copy link

I ran into this issue as well and the problem was indeed because I was still in the cloned libgdx-maven-archetype folder I had ;). Once I went up a directory into my root git folder and re-ran the command, it worked. I think this can be closed personally, unless mcgivrer is still having issues.

@davidrehakcz
Copy link

I would suggest a change within the Wiki for the install command of the archetype as follows:
mvn install archetype:update-local-catalog
Infact it just updates the local repo catalog.

@eduyayo
Copy link

eduyayo commented Feb 3, 2022

if you run the generator in a directory without a pom.xml it works... just create an empty folder and run the generator inside

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants