On Wed, Dec 14, 2011 at 12:38 PM, Daivish Shah <daivish.s...@gmail.com> wrote:
> Hi,
>
> I am trying to use Multi Module Project as follow :
>
> *            MainProject*
>                    module1
>                    module2
>
> *MainModule *- 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/xsd/maven-4.0.0.xsd";>
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>*MainProject*</groupId>
>  <artifactId>*MainProject*</artifactId>
>  <version>3.0</version>
>  <packaging>pom</packaging>
>  <modules>
>      <module>module1</module>
>      <module>module2</module>
>  </modules>
> </project>
>
> *module1 - 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/xsd/maven-4.0.0.xsd";>
>  <modelVersion>4.0.0</modelVersion>
>  <parent>
>    <artifactId>*MainProject*</artifactId>
>    <groupId>*MainProject*</groupId>
>    <version>3.0</version>
>  </parent>
>
>  <artifactId>module1</artifactId>
>
>  <dependencies>
>    <dependency>
>      <groupId>org.apache.xmlbeans</groupId>
>      <artifactId>xmlbeans</artifactId>
>      <version>2.4.0</version>
>      <scope>compile</scope>
>    </dependency>
>  </dependencies>
>  <build>
>    <plugins>
>      <plugin>
>        <groupId>org.codehaus.mojo</groupId>
>        <artifactId>xmlbeans-maven-plugin</artifactId>
>        <version>2.3.3</version>
>        <executions>
>          <execution>
>            <phase>generate-sources</phase>
>            <goals>
>              <goal>xmlbeans</goal>
>            </goals>
>          </execution>
>        </executions>
>      </plugin>
>    </plugins>
>  </build>
> </project>
>
>
> *module2 - 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/xsd/maven-4.0.0.xsd";>
>  <modelVersion>4.0.0</modelVersion>
>  <parent>
>    <artifactId>*MainProject*</artifactId>
>    <groupId>*MainProject*</groupId>
>    <version>3.0</version>
>  </parent>
>
>  <artifactId>module2</artifactId>
>
>  <dependencies>
>    <dependency>
>        <groupId>*MainProject*</groupId>
>        <artifactId>module1</artifactId>
>        <version>3.0</version>
>          <scope>compile</scope>
>    </dependency>
>  </dependencies>
>
> </project>
>
> *MAVEN settings.XML Values *
>
>   <profiles>
>    <profile>
>        <id>Repository Proxy</id>
>        <activation>
>            <activeByDefault>true</activeByDefault>
>        </activation>
>        <repositories>
>          <repository>
>                <id>artifactory.repo</id>
>                <url>http://localhost:8080/artifactory/repo/</url>
>                <releases>
>                    <enabled>true</enabled>
>                </releases>
>                <snapshots>
>                    <enabled>false</enabled>
>                </snapshots>
>          </repository>
>          <repository>
>              <id>apache.repository</id>
>              <url>http://localhost:7080/</url>
>              <releases>
>                <enabled>true</enabled>
>              </releases>
>              <snapshots>
>                <enabled>false</enabled>
>              </snapshots>
>          </repository>
>         </repositories>
>    </profile>
>
>
> ERROR LOG When trying to BUILD IT....
>
> [INFO] Scanning for projects...
> [INFO]
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building module2 3.0
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 0.266s
> [INFO] Finished at: Tue Dec 13 17:54:18 PST 2011
> [INFO] Final Memory: 2M/15M
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal on project Module2: Could not resolve
> dependencies for project MainProject:module2:jar:3.0: Failed to collect
> dependencies for [MainProject:module1:jar:3.0 (compile)]: Failed to read
> artifact descriptor for MainProject:moduel1:jar:3.0: Failure to find
> MainProject:module1:pom:3.0 in http://localhost:8080/artifactory/repo/ was
> cached in the local repository, resolution will not be reattempted until
> the update interval of artifactory.repo has elapsed or updates are forced
> -> [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/DependencyResolutionException
>
>
> What's the solution to FIX this problem? Where i am wrong here ? Please
> advice me, I am stuck at this level.
>
> Thanks,
> daivish.

You haven't provided enough information on
* what command you typed
* what directory where you in at the time

I suspect you are trying to run "mvn install" in the module2 directory.
And rightly Maven is telling you it does not have a local instance of
module1 available, nor is it available in your local repository
manager (since no one would have deployed it there).
You should run "mvn install" at the MainProject directory level.

Or you are trying to run something in the lifecycle prior to install
(See 
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html)
and therefore the jar artifact for module1 is never built to be
available in the reactor.

Have you read the freely available books at
http://maven.apache.org/articles.html?

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

Reply via email to