You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by ne...@yahoo.com.tw on 2007/10/22 02:09:27 UTC

Artifact [...] is not a dependency of the project

I encounter a new problem whilst following the sample programme at http://cwiki.apache.org/GMOxDOC20/very-simple-entity-ejb-example.html. I run the command 'mvn compile' it issues the error "Artifact [...] is not a dependency of the project." 

After searching the google, someone says that it can be amended by adding tag type at http://www.mail-archive.com/users@maven.apache.org/msg33078.html. For example, "<type>ejb</type>". Whilst another page (http://jira.codehaus.org/browse/MNG-1562?page=com.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel) reports that as a bug then it has been fixed in the later version 2.0.7. However, I still obtain the same error.

My file structure looks similar the second one.

I have 

pulication folder resided at  the top-most dir. The file structure looks like follow:

publication 
    +---[publication-ear]
    +---[publication-ejb]
    +---[publication-war]

the pom.xml which describes plugin looks like follow:

                    <artifactId> maven-ear-plugin </artifactId>
                    <configuration>
                                    <displayName> Sample EAR for publication </displayName>
                                    <description> Sample EAR for publication </description>
                                    <version>5</version>
                        <modules>
                                          <ejbModule>
                                <groupId>net.sf.sample</groupId>
                                <artifactId>publication-ejb</artifactId>
                                <bundleFileName>publication-ejb-1.0-SNAPSHOT.jar</bundleFileName>
                            </ejbModule>
                            <webModule>
                                <groupId>net.sf.sample</groupId>
                                <artifactId> publication-war </artifactId>
                                <contextRoot>/publication</contextRoot>
                                <bundleFileName>publication-war-1.0-SNAPSHOT.war</bundleFileName>
                            </webModule>
                        </modules>
                    </configuration>

How to solve this problem?

I appreciate any suggestion.

Thank you very much.







       ____________________________________________________________________________________,
想即時通知通訊錄裡的所有親朋好友好消息,就來Yahoo!奇摩電子信箱發簡訊,一次搞定!http://tw.mobile.yahoo.com/texts/mail.php

Re: Artifact [...] is not a dependency of the project

Posted by Tim Kettler <ti...@udo.edu>.
Hi,

you have to declare the ejb-jar and war as normal dependencies in the
<dependencies> section of the ear's pom. The module section in the
ear-plugin
configuration is only used for customizing some details of a module
(like you have
done with the context root). So your pom should look similar to this:

  [...]
  <dependencies>
    <dependency>
      <groupId>net.sf.sample</groupId>
      <artifactId>publication-ejb</artifactId>
      <version>YOUR_VERSION_HERE</version>
      <type>ejb</type>
    </dependency>

    <dependency>
      <groupId>net.sf.sample</groupId>
      <artifactId>publication-war</artifactId>
      <version>YOUR_VERSION_HERE</version>
      <type>war</type>
    </dependency>
  </dependencies>
  [...]
  <plugins>
    <plugin>
      <artifactId> maven-ear-plugin </artifactId>
      <configuration>
        <displayName>Sample EAR for publication</displayName>
        <description>Sample EAR for publication</description>
        <modules>
          <webModule>
            <groupId>net.sf.sample</groupId>
            <artifactId>publication-war</artifactId>
            <contextRoot>/publication</contextRoot>
          </webModule>
        </modules>
      </configuration>
    </plugin>
  </plugins>

If you are new to maven, I suggest reading the two free books on maven
written by
the deveoplers. You can find links to the books here [1], both give a good
introduction to maven and the underlying concepts and both contain a
complete
example of a JEE app developed with maven.

-Tim

[1] http://maven.apache.org/articles.html

newbie_tw@yahoo.com.tw schrieb:
> I encounter a new problem whilst following the sample programme at http://cwiki.apache.org/GMOxDOC20/very-simple-entity-ejb-example.html. I run the command 'mvn compile' it issues the error "Artifact [...] is not a dependency of the project." 
> 
> After searching the google, someone says that it can be amended by adding tag type at http://www.mail-archive.com/users@maven.apache.org/msg33078.html. For example, "<type>ejb</type>". Whilst another page (http://jira.codehaus.org/browse/MNG-1562?page=com.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel) reports that as a bug then it has been fixed in the later version 2.0.7. However, I still obtain the same error.
> 
> My file structure looks similar the second one.
> 
> I have 
> 
> pulication folder resided at  the top-most dir. The file structure looks like follow:
> 
> publication 
>     +---[publication-ear]
>     +---[publication-ejb]
>     +---[publication-war]
> 
> the pom.xml which describes plugin looks like follow:
> 
>                     <artifactId> maven-ear-plugin </artifactId>
>                     <configuration>
>                                     <displayName> Sample EAR for publication </displayName>
>                                     <description> Sample EAR for publication </description>
>                                     <version>5</version>
>                         <modules>
>                                           <ejbModule>
>                                 <groupId>net.sf.sample</groupId>
>                                 <artifactId>publication-ejb</artifactId>
>                                 <bundleFileName>publication-ejb-1.0-SNAPSHOT.jar</bundleFileName>
>                             </ejbModule>
>                             <webModule>
>                                 <groupId>net.sf.sample</groupId>
>                                 <artifactId> publication-war </artifactId>
>                                 <contextRoot>/publication</contextRoot>
>                                 <bundleFileName>publication-war-1.0-SNAPSHOT.war</bundleFileName>
>                             </webModule>
>                         </modules>
>                     </configuration>
> 
> How to solve this problem?
> 
> I appreciate any suggestion.
> 
> Thank you very much.
> 
> 
> 
> 
> 
> 
> 
>        ____________________________________________________________________________________,
> 想即時通知通訊錄裡的所有親朋好友好消息,就來Yahoo!奇摩電子信箱發簡訊,一次搞定!http://tw.mobile.yahoo.com/texts/mail.php


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org