No.1 | | 2309 bytes |
| 
Please vote for that jira
9/2/06, jiangshachina <jiangshachina (AT) gmail (DOT) comwrote:
--
Hello,
I'm newbie in Maven. I make a very simple example for Maven, but meet a
trouble.The example as follows.
The example's direcotry layout is
D:\maven
|-- example
|-- pom.xml
|-- A
|-- pom.xml
|-- B
|-- pom.xml
|-- src
|-- main
|-- java
|-- hello
|
--
[1]pom.xml at D:\maven\example
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId>example</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<modules>
<module>A</module>
</modules>
</project>
[2]pom.xml at D:\maven\example\A
<project>
<parent>
<groupId>example</groupId>
<artifactId>example</artifactId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>A</artifactId>
<packaging>pom</packaging>
<modules>
<module>B</module>
</modules>
</project>
[3]pom.xml at D:\maven\example\B
<project>
<parent>
<groupId>example</groupId>
<artifactId>A</artifactId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>B</artifactId>
<packaging>jar</packaging>
</project>
[1]If I run commond mvn compile at dir D:\maven\example\A\B, the source
will
be compiled normally.
[2]If I run commond mvn compile at dir D:\maven\example, the result is as
the same as [1].
[3]If I run commond mvn compile at dir D:\maven\example\A, the run will be
failed.
A part of the output is
"Downloading:
"
and
"Reason: Cannot find parent: example:example for project: null:A:pom:1.0"
Why the PM in dir D:\maven\exampel\A can't find its parent PM in dir
D:\maven\exampel?
But the PM in dir D:\maven\exampel\A\B can find its parent PM in dir
D:\maven\exampel\A, even its parent's parent PM in dir D:\maven\exampel?