Hi guys,
I found the key.

In management-1.0.pom, I excludes jta from hibernate dependency.
At beginning, I didn't use jta-1.0.1B, but j2ee-1.4.jar, because
jta-1.0.1B.jar isn't at central repository.
But jta is transitive dependency of yy another dependency hibernate-3.0.jar,
so I excludes it.

Serval days later, I wanted to use jta directly and installed jta-1.0.1B.jar
by manual.
Unfortunately, I didn't remove the statements of excluding.

According to the case, it seems that excluding scripts have higher priority.

a cup of Java, cheers!
Sha Jiang


jiangshachina wrote:
> 
> Hi Dawn,
> Thanks for your reply.
> I have three POM files, and all of them are very simply.
> I show the snippets of them.
> 
> managment-1.0.pom just includes dependency management.
> <modelVersion>4.0.0</modelVersion>
> <groupId>mygroup</groupId>
> <artifactId>management</artifactId>
> <packaging>pom</packaging>
> <version>1.0</version>        
> <dependencyManagement>
>       <dependencies>
>               <dependency>
>                       <groupId>javax.transaction</groupId>
>                       <artifactId>jta</artifactId>
>                       <version>1.0.1B</version>
>               </dependency>
>       <dependencies>
> <dependencyManagement>
> 
> dependency-1.0.pom just includes dependencies, which are declared in
> managment-1.0.pom.
> And the POM extends managment-1.0.pom.
> <parent>
>   <groupId>cn.net.ce.sod.operation.super</groupId>
>   <artifactId>super-management</artifactId>
>   <version>1.0</version>
> </parent>
> <modelVersion>4.0.0</modelVersion>
> <groupId>mygroup</groupId>
> <artifactId>dependency</artifactId>
> <packaging>pom</packaging>
> <version>1.0</version>
> <dependencies>
>       <dependency>
>               <groupId>javax.transaction</groupId>
>               <artifactId>jta</artifactId>
>       </dependency>
> <dependencies>
> 
> myapp pom.xml
> <parent>
>   <groupId>mygroup</groupId>
>   <artifactId>dependency</artifactId>
>   <version>1.0</version>
> </parent>
> <modelVersion>4.0.0</modelVersion>
> <groupId>mygroup</groupId>
> <artifactId>myapp</artifactId>
> <packaging>war</packaging>
> <name>myapp</name>
> 
> a cup of Java, cheers!
> Sha Jiang
> 
> 
> dawn.angelito wrote:
>> 
>> Hi Sha Jiang,
>> 
>> Did you declare this dependency in your pom? If so, please show us a
>> snippet of your pom.xml.
>> 
>> Thanks,
>> Dawn
>> 
>> 
>> jiangshachina wrote:
>>> 
>>> Hi guys,
>>> I have a Web application project.
>>> I added javax.transaction:jta:jta-1.0.1B.jar to dependency,
>>> but in fact my project doesn't need the jar.
>>> Namely, I don't need it on compile-time, test-time or runtime.
>>> 
>>> I run "mvn package", and the build was sucessful.
>>> I checked WEB-INF/lib directory, but don't find jta-1.0.1B.jar.
>>> 
>>> I always think that Maven would add any jar file in dependencies.
>>> But the case means that I'm wrong.
>>> I don't believe one case, please show me clearly.
>>> Maven can identify any useless jar and doesn't add it to war file?
>>> 
>>> a cup of Java, cheers!
>>> Sha Jiang
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Don%27t-add-dependency--tf2677027s177.html#a7483860
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to