Announcement Announcement Module
Collapse
No announcement yet.
module create error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • module create error

    hi,All:
    I am using roo 1.2.0.RELEASE
    I try to create a module using roo, this is roo script
    Code:
       project --topLevelPackage com.demo --packaging pom
       module create --moduleName module1 
       .....
    perform test is success until now.
    then I want to using parent dependency version, so I remove the version in module pom file

    parent's pom
    Code:
       <dependencyManagement>
            <dependencies>
                <!-- General dependencies for standard applications -->
                <dependency>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                    <version>4.9</version>
                    <scope>test</scope>
                </dependency>
        .....
    module's pom
    Code:
             <dependencies>
                <dependency>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </dependency>
              ......
    roo show this exception:
    Code:
        InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    using mvn install and mvn eclipse:eclipse is success

    is this a bug in roo?

    thank you very much!

  • #2
    Your module create didn't specify the parent (--parent option). However, you can add this manually to your "module1" pom

    Comment


    • #3
      Originally posted by Alan Stewart View Post
      Your module create didn't specify the parent (--parent option). However, you can add this manually to your "module1" pom
      hi,Alan:

      Thank you for reply!
      I did specify the parent, otherwise "mvn install" will not success
      I have found where cause this error: when I remove plugin's "version" tag in module pom, roo will throw exception:
      parent
      Code:
         
         <modelVersion>4.0.0</modelVersion>
          <groupId>com.demo</groupId>
          <artifactId>root</artifactId>
          <packaging>pom</packaging>
         
         ......................
      
         <dependencyManagement>
              <dependencies>
                  <!-- General dependencies for standard applications -->
                  <dependency>
                      <groupId>junit</groupId>
                      <artifactId>junit</artifactId>
                      <version>4.9</version>
                      <scope>test</scope>
                  </dependency>
      
         .............
      
         <build>
              <pluginManagement>
                  <plugins>
                      <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-war-plugin</artifactId>
                          <version>2.1.1</version>
                          <!-- <configuration> <webXml>target/web.xml</webXml> </configuration> -->
                      </plugin>
         ..........
      module:
      Code:
          <parent>
              <groupId>com.demo</groupId>
              <artifactId>root</artifactId>
              <version>1.0</version>
          </parent>
          <modelVersion>4.0.0</modelVersion>
          <groupId>com.demo.module1</groupId>
          <artifactId>module1</artifactId>
          .............
          <dependencies>
                  <dependency>
                      <groupId>junit</groupId>
                      <artifactId>junit</artifactId>
      
                      //remove dependency's version is fine!
      
                  </dependency>
                ......
      
      
      
         <build>
              <plugins>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-war-plugin</artifactId>
                      <version>2.1.1</version>    // remove plugin's version, roo will throw exception, exit roo, then using "mvn install" is success
                      <!-- <configuration> <webXml>target/web.xml</webXml> </configuration> -->
                  </plugin>
          ......
      Last edited by loveam; Jan 30th, 2012, 08:17 PM.

      Comment

      Working...
      X