You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Daivish Shah <da...@gmail.com> on 2011/12/14 03:08:16 UTC

Multi Module Project Failing - Help Me

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.

Re: Multi Module Project Failing - Help Me

Posted by Ron Wheeler <rw...@artifact-software.com>.
On 14/12/2011 4:36 PM, Daivish Shah wrote:
> Hi Barrie,
>
> I got the real problem but still looking for solution.
>
> module1 is XSD type project means it generates classes file and JAR file
> based on XSD information.
>
> And i am defining module1 project as dependency of module2 project, Still
> my eclipse is giving compilation error on import statement of module1
> package files in module2 project.
Try mvn install of module 1 by itself and see if you still have an error.
If Module1's jar file in your repo?
If you look inside the jar does it have the classes in question?

Have you tried -x to get more debugging details?

Ron
>
> Thanks,
> daivish.
>
> On Wed, Dec 14, 2011 at 12:15 PM, Barrie Treloar<ba...@gmail.com>  wrote:
>
>> On Thu, Dec 15, 2011 at 1:38 AM, Daivish Shah<da...@gmail.com>
>> wrote:
>>> There is typo, true but I used some real time project. And names if that
>>> project I changed. As I can't give names of that project.
>>>
>>> But I will tried with ur comments and MainProject pom.xml is working
>> fine.
>>> But it's giving this error on execution of module2 so is it like that I
>>> have to published module1 ? No way to work locally without that ?
>> It should work.
>>
>> That's why I suspect you have a typo, or you haven't run mvn install.
>>
>> Double and triple check the output with the values in your poms, and
>> get someone else to have a look at them too.
>> You should spot your problem.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102



Re: Multi Module Project Failing - Help Me

Posted by Stephen Connolly <st...@gmail.com>.
The automated solution is probably a patch to the xmlbeans plugin you
are using...

Given that the plugin is hosted at mojo, it should be easy for a well
structured patch with tests to get accepted. If you have issues
getting a well structured patch accepted, ping myself or Barry and I'm
sure we can help.

-Stephen

On 16 December 2011 20:51, Daivish Shah <da...@gmail.com> wrote:
> Yes I am looking for automated solution because we have 100 projects and
> almost all projects has XSD sub projects and we have to use this manual
> technic for all projects.
>
> So we can find something automated then it will make life easy. And we are
> right now converting all projects from ANT to MAVEN so if we can find some
> standard automated solution then it helps everybody in our team..
>
> Thanks,
> daivish.
>
> On Fri, Dec 16, 2011 at 11:51 AM, Barrie Treloar <ba...@gmail.com> wrote:
>
>> On Sat, Dec 17, 2011 at 4:10 AM, Daivish Shah <da...@gmail.com>
>> wrote:
>> > Hi Barrie,
>> >
>> > That's correct It's not MAVEN issue but i was thinking that whatever we
>> > define in POM.XML file as dependency eclipse must find it automatically
>> for
>> > it's compilation yes this is working well for projects which doesn't have
>> > SUB MODULEs for XSD projects.
>> >
>> > But this is not working automatically only in the case, When there is XSD
>> > Project as sub module project and that module depends internally with
>> other
>> > modules. Then i have to do manual job.
>> >
>> > Yes you are right the only quickest and easiest solution is to add that
>> JAR
>> > as dependency manually. But i was looking for something automated
>> solution.
>> >
>> > But i really appreciate your help on this to understand it properly. I
>> > always LOVE this MAVEN USER Group to resolve all my maven questions.
>>
>> Well, I'd appreciate an automated solution, but I've never cared
>> enough to hunt it down.
>> If this bugs you more than me and you would like to find the answer,
>> then that would help me and any others who want it in the future...
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>

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


Re: Multi Module Project Failing - Help Me

Posted by Daivish Shah <da...@gmail.com>.
Yes I am looking for automated solution because we have 100 projects and
almost all projects has XSD sub projects and we have to use this manual
technic for all projects.

So we can find something automated then it will make life easy. And we are
right now converting all projects from ANT to MAVEN so if we can find some
standard automated solution then it helps everybody in our team..

Thanks,
daivish.

On Fri, Dec 16, 2011 at 11:51 AM, Barrie Treloar <ba...@gmail.com> wrote:

> On Sat, Dec 17, 2011 at 4:10 AM, Daivish Shah <da...@gmail.com>
> wrote:
> > Hi Barrie,
> >
> > That's correct It's not MAVEN issue but i was thinking that whatever we
> > define in POM.XML file as dependency eclipse must find it automatically
> for
> > it's compilation yes this is working well for projects which doesn't have
> > SUB MODULEs for XSD projects.
> >
> > But this is not working automatically only in the case, When there is XSD
> > Project as sub module project and that module depends internally with
> other
> > modules. Then i have to do manual job.
> >
> > Yes you are right the only quickest and easiest solution is to add that
> JAR
> > as dependency manually. But i was looking for something automated
> solution.
> >
> > But i really appreciate your help on this to understand it properly. I
> > always LOVE this MAVEN USER Group to resolve all my maven questions.
>
> Well, I'd appreciate an automated solution, but I've never cared
> enough to hunt it down.
> If this bugs you more than me and you would like to find the answer,
> then that would help me and any others who want it in the future...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Multi Module Project Failing - Help Me

Posted by Barrie Treloar <ba...@gmail.com>.
On Sat, Dec 17, 2011 at 4:10 AM, Daivish Shah <da...@gmail.com> wrote:
> Hi Barrie,
>
> That's correct It's not MAVEN issue but i was thinking that whatever we
> define in POM.XML file as dependency eclipse must find it automatically for
> it's compilation yes this is working well for projects which doesn't have
> SUB MODULEs for XSD projects.
>
> But this is not working automatically only in the case, When there is XSD
> Project as sub module project and that module depends internally with other
> modules. Then i have to do manual job.
>
> Yes you are right the only quickest and easiest solution is to add that JAR
> as dependency manually. But i was looking for something automated solution.
>
> But i really appreciate your help on this to understand it properly. I
> always LOVE this MAVEN USER Group to resolve all my maven questions.

Well, I'd appreciate an automated solution, but I've never cared
enough to hunt it down.
If this bugs you more than me and you would like to find the answer,
then that would help me and any others who want it in the future...

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


Re: Multi Module Project Failing - Help Me

Posted by Daivish Shah <da...@gmail.com>.
Hi Barrie,

That's correct It's not MAVEN issue but i was thinking that whatever we
define in POM.XML file as dependency eclipse must find it automatically for
it's compilation yes this is working well for projects which doesn't have
SUB MODULEs for XSD projects.

But this is not working automatically only in the case, When there is XSD
Project as sub module project and that module depends internally with other
modules. Then i have to do manual job.

Yes you are right the only quickest and easiest solution is to add that JAR
as dependency manually. But i was looking for something automated solution.

But i really appreciate your help on this to understand it properly. I
always LOVE this MAVEN USER Group to resolve all my maven questions.

Thanks,
daivish.

On Thu, Dec 15, 2011 at 4:54 PM, Barrie Treloar <ba...@gmail.com> wrote:

> On Fri, Dec 16, 2011 at 5:24 AM, Daivish Shah <da...@gmail.com>
> wrote:
> > Hi Barrie Treloar,
> >
> > You suggestions looks good to me, I tried your suggestion.
> >
> > And yes this is not working only XSD generated import statements in
> Module
> > 2. I have one DAO module too which is also generating some JAR file. And
> > that is also imported in Module2 but that import statements doesn't show
> X
> > as compilation error in Eclipse but i have only problem with XSD
> generated
> > files with my Eclipse. If i execute mvn install from Top level it means
> > MainProject then it doesn't show any compilation Error in execution log.
>
> So, great that Maven is working properly.
>
> > And yes XSD project is publishing JAR file and which is located under my
> > local repository correctly. and it has all generated classes in it. So
> if i
> > manually add that Depedancy in my Eclipse then all X sign as compilation
> > error gone, But ideally it should not be Manual. If i define as
> Dependency
> > it should automatically pickup that file.
> >
> > And this is only issue with Sub Module of Main Project and XSD module.
> And
> > in MAVEN Dependency list it's showing as FOLDER icon and all other
> > dependencies are showing as JAR icon and location of those JAR files are
> > showing as my LOCAL Repository of MAVEN.
> >
> > I tried using  build-helper-maven-plugin but it doesn't help to resolve
> my
> > COMPILATION error Icons in ECLIPSE so i am confused how to resolve this
> XSD
> > related problem. If any other suggestion or advice will really
> appreciated.
>
> This is not a Maven issue.  This is an Eclipse issue.
>
> What are you using to configure Eclipse?
> If you are using the maven-eclipse-plugin I can give guidance.
> If you are using something else then I can't.
>
> The first step is to manually fix the problem.
> Which you appear to have done by manually adding the jar file as a
> dependency.
>
> For my project, I am just manually adding the
> target/<artifactId>-<version>.jar into that project's .classpath
> (Right click the jar file > build path > add to build path)
> And then export that jar file in the class file (Right click the
> project > build path > configure build path > order and export tab >
> enable jar > click ok)
>
> I haven't bothered to find a way to automate this yet.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Multi Module Project Failing - Help Me

Posted by Barrie Treloar <ba...@gmail.com>.
On Fri, Dec 16, 2011 at 5:24 AM, Daivish Shah <da...@gmail.com> wrote:
> Hi Barrie Treloar,
>
> You suggestions looks good to me, I tried your suggestion.
>
> And yes this is not working only XSD generated import statements in Module
> 2. I have one DAO module too which is also generating some JAR file. And
> that is also imported in Module2 but that import statements doesn't show X
> as compilation error in Eclipse but i have only problem with XSD generated
> files with my Eclipse. If i execute mvn install from Top level it means
> MainProject then it doesn't show any compilation Error in execution log.

So, great that Maven is working properly.

> And yes XSD project is publishing JAR file and which is located under my
> local repository correctly. and it has all generated classes in it. So if i
> manually add that Depedancy in my Eclipse then all X sign as compilation
> error gone, But ideally it should not be Manual. If i define as Dependency
> it should automatically pickup that file.
>
> And this is only issue with Sub Module of Main Project and XSD module. And
> in MAVEN Dependency list it's showing as FOLDER icon and all other
> dependencies are showing as JAR icon and location of those JAR files are
> showing as my LOCAL Repository of MAVEN.
>
> I tried using  build-helper-maven-plugin but it doesn't help to resolve my
> COMPILATION error Icons in ECLIPSE so i am confused how to resolve this XSD
> related problem. If any other suggestion or advice will really appreciated.

This is not a Maven issue.  This is an Eclipse issue.

What are you using to configure Eclipse?
If you are using the maven-eclipse-plugin I can give guidance.
If you are using something else then I can't.

The first step is to manually fix the problem.
Which you appear to have done by manually adding the jar file as a dependency.

For my project, I am just manually adding the
target/<artifactId>-<version>.jar into that project's .classpath
(Right click the jar file > build path > add to build path)
And then export that jar file in the class file (Right click the
project > build path > configure build path > order and export tab >
enable jar > click ok)

I haven't bothered to find a way to automate this yet.

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


Re: Multi Module Project Failing - Help Me

Posted by Daivish Shah <da...@gmail.com>.
Hi Barrie Treloar,

You suggestions looks good to me, I tried your suggestion.

And yes this is not working only XSD generated import statements in Module
2. I have one DAO module too which is also generating some JAR file. And
that is also imported in Module2 but that import statements doesn't show X
as compilation error in Eclipse but i have only problem with XSD generated
files with my Eclipse. If i execute mvn install from Top level it means
MainProject then it doesn't show any compilation Error in execution log.

And yes XSD project is publishing JAR file and which is located under my
local repository correctly. and it has all generated classes in it. So if i
manually add that Depedancy in my Eclipse then all X sign as compilation
error gone, But ideally it should not be Manual. If i define as Dependency
it should automatically pickup that file.

And this is only issue with Sub Module of Main Project and XSD module. And
in MAVEN Dependency list it's showing as FOLDER icon and all other
dependencies are showing as JAR icon and location of those JAR files are
showing as my LOCAL Repository of MAVEN.

I tried using  build-helper-maven-plugin but it doesn't help to resolve my
COMPILATION error Icons in ECLIPSE so i am confused how to resolve this XSD
related problem. If any other suggestion or advice will really appreciated.


Thanks,
Daivish.
On Wed, Dec 14, 2011 at 2:48 PM, Barrie Treloar <ba...@gmail.com> wrote:

> On Thu, Dec 15, 2011 at 8:06 AM, Daivish Shah <da...@gmail.com>
> wrote:
> > Hi Barrie,
> >
> > I got the real problem but still looking for solution.
> >
> > module1 is XSD type project means it generates classes file and JAR file
> > based on XSD information.
> >
> > And i am defining module1 project as dependency of module2 project, Still
> > my eclipse is giving compilation error on import statement of module1
> > package files in module2 project.
>
> There is your problem right there.
> This is an Eclipse problem not Maven.
>
> p.s when you say "I got the real problem but still looking for
> solution.", it would be handy for the archives for you to detail what
> you did so that others searching the internet can find the answers for
> next time.
>
> How are you configuring Eclipse?
> You will find that a xmlbean project will generate its source in
> target/generated-sources/xmlbeans and at least the version of
> org.codehaus.mojo:xmlbeans-maven-plugin we are using requires us to
> manually add this source directory via build-helper so that
> maven-eclipse-plugin can include that directory automatically.
>
> I do that like so
>
>       ...
>      <plugin>
>        <groupId>org.codehaus.mojo</groupId>
>        <artifactId>build-helper-maven-plugin</artifactId>
>         <executions>
>          <execution>
>            <phase>generate-sources</phase>
>            <goals>
>               <goal>add-source</goal>
>            </goals>
>            <configuration>
>              <sources>
>                <source>target/generated-sources/xmlbeans</source>
>              </sources>
>            </configuration>
>          </execution>
>        </executions>
>      </plugin>
>      ...
>    </plugins>
>  </build>
>
> By default maven-eclipse-plugin will use project references.  So
> module2 depends upon module1's project in Eclipse.
> Because the classpath for module1 has not been correctly setup (i.e.
> its missing target/generated-sources/xmlbeans) then module2 won't be
> able to build correctly.
> If module2 had been setup to use the jars in the repo instead, then
> you would not be having this problem.
> (I prefer Eclipse project references and not links to jars in the repo
> for projects that I am working on)
>
> Of course if you are not use maven-eclipse-plugin I dont know what the
> problem is, but the cause would be similar.
>
> Normally I manually fix the build path's in Eclipse to get things
> working, and then backtrack to determine why this wasn't done
> automatically for me.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Multi Module Project Failing - Help Me

Posted by Barrie Treloar <ba...@gmail.com>.
On Thu, Dec 15, 2011 at 8:06 AM, Daivish Shah <da...@gmail.com> wrote:
> Hi Barrie,
>
> I got the real problem but still looking for solution.
>
> module1 is XSD type project means it generates classes file and JAR file
> based on XSD information.
>
> And i am defining module1 project as dependency of module2 project, Still
> my eclipse is giving compilation error on import statement of module1
> package files in module2 project.

There is your problem right there.
This is an Eclipse problem not Maven.

p.s when you say "I got the real problem but still looking for
solution.", it would be handy for the archives for you to detail what
you did so that others searching the internet can find the answers for
next time.

How are you configuring Eclipse?
You will find that a xmlbean project will generate its source in
target/generated-sources/xmlbeans and at least the version of
org.codehaus.mojo:xmlbeans-maven-plugin we are using requires us to
manually add this source directory via build-helper so that
maven-eclipse-plugin can include that directory automatically.

I do that like so

       ...
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>target/generated-sources/xmlbeans</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      ...
    </plugins>
  </build>

By default maven-eclipse-plugin will use project references.  So
module2 depends upon module1's project in Eclipse.
Because the classpath for module1 has not been correctly setup (i.e.
its missing target/generated-sources/xmlbeans) then module2 won't be
able to build correctly.
If module2 had been setup to use the jars in the repo instead, then
you would not be having this problem.
(I prefer Eclipse project references and not links to jars in the repo
for projects that I am working on)

Of course if you are not use maven-eclipse-plugin I dont know what the
problem is, but the cause would be similar.

Normally I manually fix the build path's in Eclipse to get things
working, and then backtrack to determine why this wasn't done
automatically for me.

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


Re: Multi Module Project Failing - Help Me

Posted by Daivish Shah <da...@gmail.com>.
Hi Barrie,

I got the real problem but still looking for solution.

module1 is XSD type project means it generates classes file and JAR file
based on XSD information.

And i am defining module1 project as dependency of module2 project, Still
my eclipse is giving compilation error on import statement of module1
package files in module2 project.

Thanks,
daivish.

On Wed, Dec 14, 2011 at 12:15 PM, Barrie Treloar <ba...@gmail.com> wrote:

> On Thu, Dec 15, 2011 at 1:38 AM, Daivish Shah <da...@gmail.com>
> wrote:
> > There is typo, true but I used some real time project. And names if that
> > project I changed. As I can't give names of that project.
> >
> > But I will tried with ur comments and MainProject pom.xml is working
> fine.
> > But it's giving this error on execution of module2 so is it like that I
> > have to published module1 ? No way to work locally without that ?
>
> It should work.
>
> That's why I suspect you have a typo, or you haven't run mvn install.
>
> Double and triple check the output with the values in your poms, and
> get someone else to have a look at them too.
> You should spot your problem.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Multi Module Project Failing - Help Me

Posted by Barrie Treloar <ba...@gmail.com>.
On Thu, Dec 15, 2011 at 1:38 AM, Daivish Shah <da...@gmail.com> wrote:
> There is typo, true but I used some real time project. And names if that
> project I changed. As I can't give names of that project.
>
> But I will tried with ur comments and MainProject pom.xml is working fine.
> But it's giving this error on execution of module2 so is it like that I
> have to published module1 ? No way to work locally without that ?

It should work.

That's why I suspect you have a typo, or you haven't run mvn install.

Double and triple check the output with the values in your poms, and
get someone else to have a look at them too.
You should spot your problem.

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


Re: Multi Module Project Failing - Help Me

Posted by Daivish Shah <da...@gmail.com>.
There is typo, true but I used some real time project. And names if that
project I changed. As I can't give names of that project.

But I will tried with ur comments and MainProject pom.xml is working fine.
But it's giving this error on execution of module2 so is it like that I
have to published module1 ? No way to work locally without that ?

On Dec 13, 2011 9:19 PM, "Barrie Treloar" <ba...@gmail.com> wrote:

On Wed, Dec 14, 2011 at 3:27 PM, Daivish Shah <da...@gmail.com>
wrote:
> Hi Barrie,
>
> MainP...
Carefully read your error logs and look for typos.
Because you have sanitised the output I can not be certain, but there
is a typo which Maven reports as
MainProject:moduel1:jar:3.0 (instead of module1)


---------------------------------------------------------------------
To unsubscribe, e-mail: users...

Re: Multi Module Project Failing - Help Me

Posted by Barrie Treloar <ba...@gmail.com>.
On Wed, Dec 14, 2011 at 3:27 PM, Daivish Shah <da...@gmail.com> wrote:
> Hi Barrie,
>
> MainProject*
>>                    module1
>>                    module2
>
> First of all i executed mvn install on module1 project and it
> executed successfully...
>
> Then module2 has dependency on module1 artifact so i added that project in
> module2, And on "mvn install"  command it's throwing this exception.
>
> Thanks,
> Daivish.

Carefully read your error logs and look for typos.
Because you have sanitised the output I can not be certain, but there
is a typo which Maven reports as
MainProject:moduel1:jar:3.0 (instead of module1)

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


Re: Multi Module Project Failing - Help Me

Posted by Daivish Shah <da...@gmail.com>.
Hi Barrie,

MainProject*
>                    module1
>                    module2

First of all i executed mvn install on module1 project and it
executed successfully...

Then module2 has dependency on module1 artifact so i added that project in
module2, And on "mvn install"  command it's throwing this exception.

Thanks,
Daivish.

On Tue, Dec 13, 2011 at 8:16 PM, Barrie Treloar <ba...@gmail.com> wrote:

> On Wed, Dec 14, 2011 at 12:38 PM, Daivish Shah <da...@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-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Multi Module Project Failing - Help Me

Posted by Barrie Treloar <ba...@gmail.com>.
On Wed, Dec 14, 2011 at 12:38 PM, Daivish Shah <da...@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-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org