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 <[email protected]> wrote:

> On Thu, Dec 15, 2011 at 8:06 AM, Daivish Shah <[email protected]>
> 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: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to