Skip to main content



      Home
Home » Modeling » TMF (Xtext) » problem with pom.xml for my xtext example project(howto create correct pom.xml for existing project)
problem with pom.xml for my xtext example project [message #698847] Wed, 20 July 2011 07:18 Go to next message
Eclipse UserFriend
Hi,

I'm a beginner of Xtext and also maven. I have create the "Xtext Domain-Model Example". now I have "org.example.domainmodel","org.example.domainmodel.ui" and "org.example.domainmodel.tests" in my workspace.
at first, what i want to do is create a correct pom.xml file for the "org.example.domainmodel". compare to dependency of MANIFEST.MF I have edit my pom.xml:

<project xmlns="http:/ /maven.apache.org/POM/4.0.0" xmlns:xsi="http:/ /www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http:/ /maven.apache.org/POM/4.0.0 http:/ /maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.example.domainmodel</groupId>
  <artifactId>org.example.domainmodel</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>my-app</name>
  <url>http:/ /maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>org.eclipse</groupId>
      <artifactId>xtext</artifactId>
      <version>2.0.0</version>
    </dependency> 
	   <dependency>
      <groupId>org.apache</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.15</version>
    </dependency>
 	   <dependency>
      <groupId> org.apache</groupId>
      <artifactId>commons.logging</artifactId>
      <version>1.0.4</version>
	  <optional>true</optional>
    </dependency>

	   <dependency>
      <groupId>org.eclipse</groupId>
      <artifactId>xtext.generator</artifactId>
      <version>2.0.0</version>
	  <optional>true</optional>
    </dependency>
	   <dependency>
      <groupId>org.eclipse</groupId>
      <artifactId>emf.codegen.ecore</artifactId>
      <version>2.7.0</version>
	  <optional>true</optional>
    </dependency>
	   <dependency>
      <groupId>org.eclipse</groupId>
      <artifactId>emf.mwe.utils</artifactId>
      <version>1.1.0</version>
	  <optional>true</optional>
    </dependency>
	   <dependency>
      <groupId>org.eclipse</groupId>
      <artifactId>emf.mwe2.launch</artifactId>
      <version>2.0.0</version>
	  <optional>true</optional>
    </dependency>
	   <dependency>
      <groupId>org.eclipse</groupId>
      <artifactId>xtext.util</artifactId>
      <version>2.0.0</version>
    </dependency>
	   <dependency>
      <groupId>org.eclipse</groupId>
      <artifactId>emf.ecore</artifactId>
      <version>2.7.0</version>
    </dependency>
	   <dependency>
      <groupId>org.eclipse</groupId>
      <artifactId>emf.common</artifactId>
      <version>2.7.0</version>
    </dependency>
	   <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>runtime</artifactId>
      <version>3.2.0</version>
    </dependency>
	   <dependency>
      <groupId>org.eclipse</groupId>
      <artifactId>xtext.common.types</artifactId>
      <version>2.0.0</version>
    </dependency>
  </dependencies>
  <build>
        <resources>
            <resource>
                <directory>src</directory>
            </resource>
		</resources>
	</build>
</project>

after run
C:\workspace\org.example.domainmodel>mvn archetype:generate -DgroupId=o
rg.example.domainmodel -DartifactId=org.example.domainmodel -Dpackage org.exampl
e.domainmodel -Dversion=1.0-SNAPSHOT

i got this:
Choose a number: 110: Choose version: 
1: 1.0-alpha-1
2: 1.0-alpha-2
3: 1.0-alpha-3
4: 1.0-alpha-4
5: 1.0
6: 1.1
Choose a number: 6: 
[INFO] Using property: groupId = org.example.domainmodel
[INFO] Using property: artifactId = org.example.domainmodel
[INFO] Using property: version = 1.0-SNAPSHOT
[INFO] Using property: package = true
Confirm properties configuration:
groupId: org.example.domainmodel
artifactId: org.example.domainmodel
version: 1.0-SNAPSHOT
package: true
 Y: :
[INFO] -------------------------------------------------------------------------
---
[INFO] Using following parameters for creating project from Old (1.x) Archetype:
 maven-archetype-quickstart:1.1
[INFO] -------------------------------------------------------------------------
---
[INFO] Parameter: groupId, Value: org.example.domainmodel
[INFO] Parameter: packageName, Value: true
[INFO] Parameter: package, Value: true
[INFO] Parameter: artifactId, Value: org.example.domainmodel
[INFO] Parameter: basedir, Value: C:\Work\MavenExporter\org.example.domainmodel
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[ERROR] Unable to add module to the current project as it is not of packaging ty
pe 'pom'
org.apache.maven.archetype.old.ArchetypeTemplateProcessingException: Unable to a
dd module to the current project as it is not of packaging type 'pom'
        at org.apache.maven.archetype.old.DefaultOldArchetype.createArchetype(De
faultOldArchetype.java:313)
        at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.proces
sOldArchetype(DefaultArchetypeGenerator.java:142)
        at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.genera
teArchetype(DefaultArchetypeGenerator.java:110)
        at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.genera
teArchetype(DefaultArchetypeGenerator.java:149)
        at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.genera
teArchetype(DefaultArchetypeGenerator.java:209)
        at org.apache.maven.archetype.DefaultArchetypeManager.generateProjectFro
mArchetype(DefaultArchetypeManager.java:71)
        at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execu
te(CreateProjectFromArchetypeMojo.java:190)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.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.buildProje
ct(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        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:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Skipping my-app
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.375s
[INFO] Finished at: Wed Jul 20 11:27:22 CEST 2011
[INFO] Final Memory: 7M/17M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2
.0:generate (default-cli) on project org.example.domainmodel: Unable to add modu
le 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 swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http:/ /cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption

the Attachment is complete error log.
could anyone please teil me, what was the problem?
many Thanks!
  • Attachment: error.log
    (Size: 34.28KB, Downloaded 135 times)
Re: problem with pom.xml for my xtext example project [message #698886 is a reply to message #698847] Wed, 20 July 2011 08:31 Go to previous messageGo to next message
Eclipse UserFriend
any idea or tips?
Re: problem with pom.xml for my xtext example project [message #698894 is a reply to message #698886] Wed, 20 July 2011 08:39 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

only that you might google "Xtext Maven" to find Karsten's blogs on the topic.

Alex
Re: problem with pom.xml for my xtext example project [message #698910 is a reply to message #698894] Wed, 20 July 2011 09:06 Go to previous message
Eclipse UserFriend
good!
it meets my theme exactly. i will have a try, it should solve my problem.
Thanks a lot!
Previous Topic:Content Assist
Next Topic:Beginner problem using EOF token
Goto Forum:
  


Current Time: Sun Jul 27 04:59:01 EDT 2025

Powered by FUDForum. Page generated in 0.04813 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top