You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by 梦秋雨 <gu...@163.com> on 2008/11/13 16:14:52 UTC
Help me: Compile error!
Hello everyone,
I get a problem when I try to use maven to compile my application. I can not find a solution by google,so ,I'm here :)
First,I create an web application depends on hibernate, and install it into my local repository,so there is a war package in my repository.
Then I create the second application. In pom.xml,I add a dependency to the first application. after that,I create a class in this application.
In this class,I use some hibernate api.
Then I use "mvn compile" command to compile the application. Here I get my problem:compile fail, error message is "can not find symbol". It
seems that maven do not know the first application depends on hibernate!
So,why?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Re: Help me: Compile error!
Posted by 梦秋雨 <gu...@163.com>.
Thank you,Nick.
So,is this the only way?
>Because the dependencies of your dependencies (so called transitive
>dependencies) will not be taken into account for your build path
>during compile. If you (this means, the java files in your module)
>have a compile time dependency on some other classes you have to
>declare them as a dependency.
>
>Hth,
>
>
>Nick Stolwijk
>~Java Developer~
>
>Iprofs BV.
>Claus Sluterweg 125
>2012 WS Haarlem
>www.iprofs.nl
>
>
>
>On Thu, Nov 13, 2008 at 4:14 PM, 梦秋雨 <gu...@163.com> wrote:
>> Hello everyone,
>>
>> I get a problem when I try to use maven to compile my application. I can not find a solution by google,so ,I'm here :)
>>
>> First,I create an web application depends on hibernate, and install it into my local repository,so there is a war package in my repository.
>> Then I create the second application. In pom.xml,I add a dependency to the first application. after that,I create a class in this application.
>> In this class,I use some hibernate api.
>>
>> Then I use "mvn compile" command to compile the application. Here I get my problem:compile fail, error message is "can not find symbol". It
>> seems that maven do not know the first application depends on hibernate!
>>
>> So,why?
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
Re: Help me: Compile error!
Posted by Nick Stolwijk <ni...@gmail.com>.
Because the dependencies of your dependencies (so called transitive
dependencies) will not be taken into account for your build path
during compile. If you (this means, the java files in your module)
have a compile time dependency on some other classes you have to
declare them as a dependency.
Hth,
Nick Stolwijk
~Java Developer~
Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl
On Thu, Nov 13, 2008 at 4:14 PM, 梦秋雨 <gu...@163.com> wrote:
> Hello everyone,
>
> I get a problem when I try to use maven to compile my application. I can not find a solution by google,so ,I'm here :)
>
> First,I create an web application depends on hibernate, and install it into my local repository,so there is a war package in my repository.
> Then I create the second application. In pom.xml,I add a dependency to the first application. after that,I create a class in this application.
> In this class,I use some hibernate api.
>
> Then I use "mvn compile" command to compile the application. Here I get my problem:compile fail, error message is "can not find symbol". It
> seems that maven do not know the first application depends on hibernate!
>
> So,why?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: Re: Help me: Compile error!
Posted by 梦秋雨 <gu...@163.com>.
Thank you for your reply.
The second application is a web applicatoin.
when I execute war:inplace I can got every thing of the first app.
>On Thu, Nov 13, 2008 at 8:14 AM, 梦秋雨 <gu...@163.com> wrote:
>
>> First,I create an web application depends on hibernate, and install it into my local repository,so there is a war package in my repository.
>> Then I create the second application. In pom.xml,I add a dependency to the first application.
>
>Does this mean your second application has a dependency on the *war*
>from the first application?
>
>If the second app is also a war, you'll get a war overlay.
>
>If the second one is a jar, it won't do anything useful -- Java
>doesn't have the concept of a war on the classpath.
>
>--
>Wendy
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: Help me: Compile error!
Posted by Wendy Smoak <ws...@gmail.com>.
On Thu, Nov 13, 2008 at 8:14 AM, 梦秋雨 <gu...@163.com> wrote:
> First,I create an web application depends on hibernate, and install it into my local repository,so there is a war package in my repository.
> Then I create the second application. In pom.xml,I add a dependency to the first application.
Does this mean your second application has a dependency on the *war*
from the first application?
If the second app is also a war, you'll get a war overlay.
If the second one is a jar, it won't do anything useful -- Java
doesn't have the concept of a war on the classpath.
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org