Re: Don't add dependency?
On 11/25/06, jiangshachina [EMAIL PROTECTED] wrote: For example, on jta artifact. others POM declares jta-1.0.B.jar as dependency directly, and spring-parent.pom(Spring artifacts' parent POM) declares jta as optional. Then jta-1.0.B.jar wasn't in WEB-INF/lib, too. Correct. Optional dependencies are not transitive. If jta is optional for Spring, and you want it, you'll need to declare it. I removed all of optional on jta, then run mvn package. The result was the same, jta-1.0.1B.jar still wasn't in WEB-INF/lib. And I search the repository, no dependency declares jta in excludes block. I'm very blocked by the matter? Early in this thread you posted a pom snippet that used dependencyManagement, and I wonder if that's where you're making the changes that don't seem to take effect. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Don't add dependency?
Hi Wendy, Correct. Optional dependencies are not transitive. If jta is optional for Spring, and you want it, you'll need to declare it. I had done. I declared jta-1.0.1B.jar as dependency(not dependency management) explicitly. Early in this thread you posted a pom snippet that used dependencyManagement, and I wonder if that's where you're making the changes that don't seem to take effect. Yes, I used dependencyManagement originally. But now, I only use dependency, there is no dependencyManagement. a cup of Java, cheers! Sha Jiang Wendy Smoak-3 wrote: On 11/25/06, jiangshachina [EMAIL PROTECTED] wrote: For example, on jta artifact. others POM declares jta-1.0.B.jar as dependency directly, and spring-parent.pom(Spring artifacts' parent POM) declares jta as optional. Then jta-1.0.B.jar wasn't in WEB-INF/lib, too. Correct. Optional dependencies are not transitive. If jta is optional for Spring, and you want it, you'll need to declare it. I removed all of optional on jta, then run mvn package. The result was the same, jta-1.0.1B.jar still wasn't in WEB-INF/lib. And I search the repository, no dependency declares jta in excludes block. I'm very blocked by the matter? Early in this thread you posted a pom snippet that used dependencyManagement, and I wonder if that's where you're making the changes that don't seem to take effect. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Don%27t-add-dependency--tf2677027s177.html#a7553799 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Don't add dependency?
Hi, Additionally, at the begging of the project, I set all dependencies in only one pom. At that time, all was OK. It sounds that the relation was very clean and simple. But now, why I have to encounter so ambiguous relationship?! Now, I have to return to the original POMs. Then all is OK. There's no ambiguous relationship, and both of jta-1.0.1B.jar and servlet-api-2.4.jar(not 2.3) are in WEB-INF/lib and Eclipse .classpath file. Can one POM extend multi-POMs? In my test, that is forbidden. a cup of Java, cheers! Sha Jiang jiangshachina wrote: Hi Wendy, Correct. Optional dependencies are not transitive. If jta is optional for Spring, and you want it, you'll need to declare it. I had done. I declared jta-1.0.1B.jar as dependency(not dependency management) explicitly. Early in this thread you posted a pom snippet that used dependencyManagement, and I wonder if that's where you're making the changes that don't seem to take effect. Yes, I used dependencyManagement originally. But now, I only use dependency, there is no dependencyManagement. a cup of Java, cheers! Sha Jiang Wendy Smoak-3 wrote: On 11/25/06, jiangshachina [EMAIL PROTECTED] wrote: For example, on jta artifact. others POM declares jta-1.0.B.jar as dependency directly, and spring-parent.pom(Spring artifacts' parent POM) declares jta as optional. Then jta-1.0.B.jar wasn't in WEB-INF/lib, too. Correct. Optional dependencies are not transitive. If jta is optional for Spring, and you want it, you'll need to declare it. I removed all of optional on jta, then run mvn package. The result was the same, jta-1.0.1B.jar still wasn't in WEB-INF/lib. And I search the repository, no dependency declares jta in excludes block. I'm very blocked by the matter? Early in this thread you posted a pom snippet that used dependencyManagement, and I wonder if that's where you're making the changes that don't seem to take effect. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Don%27t-add-dependency--tf2677027s177.html#a7554005 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Don't add dependency?
Hello, I encountered a similar trouble. I have a Web application, which is built on Struts, Spring and Hibernate. At beginning, I added all of dependencies in one POM, then my real application project extends the POM(artifact). But since more and more artifacts are depended. The POM is more and more bigger. Now I split the POM into six smaller POMs. They declare dependencies on Struts, Spring, Hibernate, Apache, javax and others respectively. And they have following extension hierarchy, others--javax--Apache--Hibernate--Spring--Struts But in fact, the relation on dependency is complicated. Because many dependencies have transitive dependencies. Some dependencies may have same transitive dependencies, but version are different. For example, on servlet-api artiface. I declare servlet-api-2.4.jar in others POM, but commons-loggin(in Apache POM) has transitive dependency servlet-api-2.3.jar. Both of them are compile scope. When I run mvn package for the Web project, I found that servlet-api-2.3.jar, but servlet-api-2.4.jar, in WEB-INF/lib. If I modified POM of commons-loggin, and declared servlet-api-2.3.jar as provided dependency, then none of them would be put into WEB-INF/lib! For example, on jta artifact. others POM declares jta-1.0.B.jar as dependency directly, and spring-parent.pom(Spring artifacts' parent POM) declares jta as optional. Then jta-1.0.B.jar wasn't in WEB-INF/lib, too. The trouble is very very trouble. How to explain and solve the problem? Thanks in advance! a cup of Java, cheers! Sha Jiang Jörg Schaible wrote: jiangshachina wrote on Wednesday, November 22, 2006 2:38 AM: 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. No, it is worse. It depends on the internal sequence the deps are processed. If the local jta declaration is found before the hibernate one, jta would have been *not* excluded. Since the sequence of this list changes with every arbitrary added or removed dep (or new version) I believe that is based on a iterator over a hash map ... which makes it really annoying. The bug is supposed to be fixed since months in subversion though ... like so many other ones. - Jörg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Don%27t-add-dependency--tf2677027s177.html#a7537433 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Don't add dependency?
On 11/25/06, jiangshachina [EMAIL PROTECTED] wrote: For example, on servlet-api artiface. I declare servlet-api-2.4.jar in others POM, but commons-loggin(in Apache POM) has transitive dependency servlet-api-2.3.jar. Both of them are compile scope. These poms are incorrect -- servlet-api shouldn't be in compile scope. When I run mvn package for the Web project, I found that servlet-api-2.3.jar, but servlet-api-2.4.jar, in WEB-INF/lib. If I modified POM of commons-loggin, and declared servlet-api-2.3.jar as provided dependency, then none of them would be put into WEB-INF/lib! Modifying public poms is one way to do it, and can work if you have complete control of an internal corporate repository. A better way to fix this is to add exclusions to the dependencies that are causing the problem, then go back to the project in question and ask them to fix it in the next release. Quite often the project causing the problem is not using m2 to build, and the developers don't understand what happens when they leave everything in compile scope. Another way that will work is to declare the servlet-api dependency in your own project and properly mark it 'provided'. Since Maven uses the closest definition for each artifact, that one will win. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Don't add dependency?
Hi Wendy, These poms are incorrect -- servlet-api shouldn't be in compile scope. I see. Another way that will work is to declare the servlet-api dependency in your own project and properly mark it 'provided'. Since Maven uses the closest definition for each artifact, that one will win. [1]If I set both of servlet-api-2.3(in commons-logging-1.1.pom) and servlet-api-2.4(in my own declared pom) to provided scope. Then run mvn package, none of them would be putted into WEB-INF/lib; run mvn eclipse:eclipse, none of them would be in .classpath file. That 's not my want. I wish servlet-api-2.4.jar in .classpath file. [2]If I set both of them to compile scope. Then run mvn package, only servlet-api-2.3.jar would be puutted into WEB-INF/lib; run mvn eclipse:eclipse, only servlet-api-2.3.jar in .classpath file. [3]If I set servlet-api-2.4.jar to compile scope, and modify commons-loggin-1.1.pom and set servlet-api-2.3.jar to provided scope. Then run mvn package, none of servlet-api would be putted in WEB-INF/lib; run mvn eclipse:eclipse, none would be in .classpath. According the three cases, it really means that Maven uses the closest scope for one dependency. But what about version? Maven how to pick up dependencies? What's the regular for choosing version? Lower or higher? According to the my casees above, it seems that Maven likes the lower one? a cup of Java, cheers! Sha Jiang Wendy Smoak-3 wrote: On 11/25/06, jiangshachina [EMAIL PROTECTED] wrote: For example, on servlet-api artiface. I declare servlet-api-2.4.jar in others POM, but commons-loggin(in Apache POM) has transitive dependency servlet-api-2.3.jar. Both of them are compile scope. These poms are incorrect -- servlet-api shouldn't be in compile scope. When I run mvn package for the Web project, I found that servlet-api-2.3.jar, but servlet-api-2.4.jar, in WEB-INF/lib. If I modified POM of commons-loggin, and declared servlet-api-2.3.jar as provided dependency, then none of them would be put into WEB-INF/lib! Modifying public poms is one way to do it, and can work if you have complete control of an internal corporate repository. A better way to fix this is to add exclusions to the dependencies that are causing the problem, then go back to the project in question and ask them to fix it in the next release. Quite often the project causing the problem is not using m2 to build, and the developers don't understand what happens when they leave everything in compile scope. Another way that will work is to declare the servlet-api dependency in your own project and properly mark it 'provided'. Since Maven uses the closest definition for each artifact, that one will win. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Don%27t-add-dependency--tf2677027s177.html#a7545093 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Don't add dependency?
Hi Wendy, For example, on jta artifact. others POM declares jta-1.0.B.jar as dependency directly, and spring-parent.pom(Spring artifacts' parent POM) declares jta as optional. Then jta-1.0.B.jar wasn't in WEB-INF/lib, too. I think I was wrong on optinal I removed all of optional on jta, then run mvn package. The result was the same, jta-1.0.1B.jar still wasn't in WEB-INF/lib. And I search the repository, no dependency declares jta in excludes block. I'm very blocked by the matter? Additionally, at the begging of the project, I set all dependencies in only one pom. At that time, all was OK. It sounds that the relation was very clean and simple. But now, why I have to encounter so ambiguous relationship?! The trouble is veryveryvery trouble :( a cup of Java, cheers! Sha Jiang Wendy Smoak-3 wrote: On 11/25/06, jiangshachina [EMAIL PROTECTED] wrote: For example, on servlet-api artiface. I declare servlet-api-2.4.jar in others POM, but commons-loggin(in Apache POM) has transitive dependency servlet-api-2.3.jar. Both of them are compile scope. These poms are incorrect -- servlet-api shouldn't be in compile scope. When I run mvn package for the Web project, I found that servlet-api-2.3.jar, but servlet-api-2.4.jar, in WEB-INF/lib. If I modified POM of commons-loggin, and declared servlet-api-2.3.jar as provided dependency, then none of them would be put into WEB-INF/lib! Modifying public poms is one way to do it, and can work if you have complete control of an internal corporate repository. A better way to fix this is to add exclusions to the dependencies that are causing the problem, then go back to the project in question and ask them to fix it in the next release. Quite often the project causing the problem is not using m2 to build, and the developers don't understand what happens when they leave everything in compile scope. Another way that will work is to declare the servlet-api dependency in your own project and properly mark it 'provided'. Since Maven uses the closest definition for each artifact, that one will win. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Don%27t-add-dependency--tf2677027s177.html#a7545206 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Don't add dependency?
Hi Jörg, Thanks very much! You released one of my agony. a cup of Java, cheers! Sha Jiang Jörg Schaible wrote: jiangshachina wrote on Wednesday, November 22, 2006 2:38 AM: 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. No, it is worse. It depends on the internal sequence the deps are processed. If the local jta declaration is found before the hibernate one, jta would have been *not* excluded. Since the sequence of this list changes with every arbitrary added or removed dep (or new version) I believe that is based on a iterator over a hash map ... which makes it really annoying. The bug is supposed to be fixed since months in subversion though ... like so many other ones. - Jörg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Don%27t-add-dependency--tf2677027s177.html#a7487130 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Don't add dependency?
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#a7469026 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Don't add dependency?
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. modelVersion4.0.0/modelVersion groupIdmygroup/groupId artifactIdmanagement/artifactId packagingpom/packaging version1.0/version dependencyManagement dependencies dependency groupIdjavax.transaction/groupId artifactIdjta/artifactId version1.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 groupIdcn.net.ce.sod.operation.super/groupId artifactIdsuper-management/artifactId version1.0/version /parent modelVersion4.0.0/modelVersion groupIdmygroup/groupId artifactIddependency/artifactId packagingpom/packaging version1.0/version dependencies dependency groupIdjavax.transaction/groupId artifactIdjta/artifactId /dependency dependencies myapp pom.xml parent groupIdmygroup/groupId artifactIddependency/artifactId version1.0/version /parent modelVersion4.0.0/modelVersion groupIdmygroup/groupId artifactIdmyapp/artifactId packagingwar/packaging namemyapp/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]
Re: Don't add dependency?
Hi Check out this, it should be the reason jta isn't added you have to install it manually! http://maven.apache.org/guides/mini/guide-coping-with-sun-jars.html Greetings, 2006/11/21, jiangshachina [EMAIL PROTECTED]: 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#a7466108 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- === Utan tvivel är man inte riktigt klok. (Tage Danielsson)
Re: Don't add dependency?
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. modelVersion4.0.0/modelVersion groupIdmygroup/groupId artifactIdmanagement/artifactId packagingpom/packaging version1.0/version dependencyManagement dependencies dependency groupIdjavax.transaction/groupId artifactIdjta/artifactId version1.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 groupIdcn.net.ce.sod.operation.super/groupId artifactIdsuper-management/artifactId version1.0/version /parent modelVersion4.0.0/modelVersion groupIdmygroup/groupId artifactIddependency/artifactId packagingpom/packaging version1.0/version dependencies dependency groupIdjavax.transaction/groupId artifactIdjta/artifactId /dependency dependencies myapp pom.xml parent groupIdmygroup/groupId artifactIddependency/artifactId version1.0/version /parent modelVersion4.0.0/modelVersion groupIdmygroup/groupId artifactIdmyapp/artifactId packagingwar/packaging namemyapp/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#a7469448 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Don't add dependency?
Hi, I'm sorry that I didin't represent myself clearly. I have installed jta by manual, and jta-1.0.1B.jar is in my local repository now. If the jar file isn't existent, my build would be failed. a cup of Java, cheers! Sha Jiang Bengt-Erik Fröberg-2 wrote: Hi Check out this, it should be the reason jta isn't added you have to install it manually! http://maven.apache.org/guides/mini/guide-coping-with-sun-jars.html Greetings, 2006/11/21, jiangshachina [EMAIL PROTECTED]: 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#a7466108 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- === Utan tvivel är man inte riktigt klok. (Tage Danielsson) -- View this message in context: http://www.nabble.com/Don%27t-add-dependency--tf2677027s177.html#a7467651 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Don't add dependency?
Hi, I have four tests just now. [1]I added following artifact to dependency dependency groupIdasm/groupId artifactIdasm/artifactId version1.5.3/version /dependency then run mvn package, asm-1.5.3.jar was in WEB-INF/lib [2]I added following scripts to pom.xml dependency groupIdjavax.transaction/groupId artifactIdjta/artifactId version15/version /dependency obviously, there isn't jta-15.jar in real world. Then run mvn package, build was sucessful too, none of error is thrown!!! [3]I just use following dependency groupIdjavax.transaction/groupId artifactIdjta/artifactId version1.0.1B/version /dependency run mvn eclipse:eclipse, jta-1.0.1B.jar was in .classpath. It means that Maven can find the artifact. [4]I just use following dependency groupIdjavax.transaction/groupId artifactIdjta/artifactId version15/version /dependency run mvn eclipse:eclipse, Maven tried to download jta-15.pom, off course found nothing. It means that Maven knows jta-15 isn't existent. The four test above are very strange! How to explain the matter? a cup of Java, cheers! Sha Jiang jiangshachina wrote: Hi, I'm sorry that I didin't represent myself clearly. I have installed jta by manual, and jta-1.0.1B.jar is in my local repository now. If the jar file isn't existent, my build would be failed. a cup of Java, cheers! Sha Jiang Bengt-Erik Fröberg-2 wrote: Hi Check out this, it should be the reason jta isn't added you have to install it manually! http://maven.apache.org/guides/mini/guide-coping-with-sun-jars.html Greetings, 2006/11/21, jiangshachina [EMAIL PROTECTED]: 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#a7466108 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- === Utan tvivel är man inte riktigt klok. (Tage Danielsson) -- View this message in context: http://www.nabble.com/Don%27t-add-dependency--tf2677027s177.html#a7467925 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Don't add dependency?
jiangshachina wrote on Wednesday, November 22, 2006 2:38 AM: 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. No, it is worse. It depends on the internal sequence the deps are processed. If the local jta declaration is found before the hibernate one, jta would have been *not* excluded. Since the sequence of this list changes with every arbitrary added or removed dep (or new version) I believe that is based on a iterator over a hash map ... which makes it really annoying. The bug is supposed to be fixed since months in subversion though ... like so many other ones. - Jörg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]