Re: DependencyResolutionException when upgrading from Maven 2.2.1 to Maven 3.0.4
Hi, Brain Dump wrote: Hey -- sorry about the information overload. I've seen other posts on other forums where people posted too little information and were asked to post their source code or run something on full debug, etc., so I tried to be complete. Didn't mean to overwhelm, and thanks for the responses. Simply said, the dependency child-dep-jdk15 was handled without a problem in Maven 2.2.1 but its presence causes Maven 3.0.4 to look for the parent POM in remote repositories. Both child-alpha and child-dep-jdk15 have the same parent. The dependency child-dep-jdk15 was separately compiled and available on our own remote repository. I did try adding relativePath../pom.xml/relativePath to the parent section of child-alpha, and that had no effect. The only two things that I've managed to do to get the build to succeed is to (1) remove the dependency listed within profiles/profiles of child-alpha, or (2) first run mvn -N install on the parent first. So it seems that the presence of the dependency is what's causing the problem, but I don't understand why. (I haven't tried starting from scratch yet.) Neither option above is okay because I need that dependency, and running mvn -N install would be complicated for branching and our continuous integration server. 1/ Your parent is not a SNAPSHOT version (*), therefore M3 might resolve it from the repository and ignore any relativePath element. 2/ You seem to define the repository in the POM. Don't do this. M3 might ignore these, because you could never really control foreign repositories defined in arbitrary POMs. Repositories should be declared in your settings.xml. 3/ Because of 1 and 2, M3 might fail to resolve the parent POM. *) You should never build a non-SNAPSHOT version except when releasing it. - Jörg - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: DependencyResolutionException when upgrading from Maven 2.2.1 to Maven 3.0.4
Just want to thank you all -- Stephen, Jörg, Wayne, John, Mike -- for your help. From your comments, it looks like there are some non-ideal ways my pom.xml files have been set up. Getting all this fixed up to switch to Maven 3 is out of scope for our team at the moment, but I'm going to save all your comments so we have a good starting point when we can get back to this upgrade. Thanks again for your help.
Re: DependencyResolutionException when upgrading from Maven 2.2.1 to Maven 3.0.4
I was able to compile with no problems on 2.2.1. The only pom.xml changes I had to make to get this (almost) working on 3.0.4 was to add version numbers for plugins that didn't have them specified, move plugins under reporting/reporting into build/build, and run mvn -N install on the parent pom -- although that's what I'm trying to avoid. I don't know if the issues you're running into are related, or caused by something else. Any thoughts from anyone about either Mike's issues, or mine? Thanks! On Tue, Apr 10, 2012 at 12:37 PM, mike digioia mpd...@gmail.com wrote: Hi, I just posted a similar issue I am having with the same kind of errors. Did you ever get this to compile on the 2.2.1? I have built two machines, one with 2.2.1 and the other one with 3.0.4. I have different problems with each. Main issue with 3.0.4 is it could not locate some of my dependency jars. So I copied them from the 2.2.1 release system. But still issues. The other main issue is using extension to java/javax with the jmdns.jar. So I modified the classes inside this jar to avoid the problem but still have issues. On the 2.2.1 system it does not see my jar, even though it is inside the pom and was successful with the mvn install-file command. On Tue, Apr 10, 2012 at 12:19 PM, Brain Dump braindump2...@gmail.com wrote: Hi everyone, I'm trying to upgrade my project from Maven 2.2.1 to Maven 3.0.4 but am running into problems with a dependency resolution. I spent a full day trying to research this by looking through Maven documentation and similar posts, but I'm still stuck. I posted on stackoverflow ( http://stackoverflow.com/q/10092772/1324379) but realized that this Maven User List might be a better place to ask for help. Hope that's okay, and thanks in advance for your help. My project structure is as follows: pom.xml (acme-parent) child-alpha +- pom.xml In addition, I have the following files in my own repository: http://maven.my-own-repo.com/acme/child-dep-jdk15/maven-metadata-local.xml http://maven.my-own-repo.com/acme/child-dep-jdk15/1.0/child-dep-jdk15-1.0.jar http://maven.my-own-repo.com/acme/child-dep-jdk15/1.0/child-dep-jdk15-1.0.pom child-alpha/pom.xml in turn has a profile dependency on my own acme:child-dep-jdk15, which has been separately built into a jar file and has its own .pom file specifying a parent that is the same acme-parent parent as child-alpha. Here are excerpts from the relevant files: acme-parent pom.xml: ?xml version=1.0 encoding=UTF-8? project modelVersion4.0.0/modelVersion groupIdacme/groupId artifactIdacme-parent/artifactId nameAcme Parent Project/name version1/version packagingpom/packaging properties.../properties modules modulechild-alpha/module /modules repositories repository idacme-repo/id urlhttp://maven.my-own-repo.com/url /repository repository idcentral/id urlhttp://repo1.maven.org/maven2/url /repository /repositories pluginRepositories.../pluginRepositories build plugins.../plugins /build dependencies.../dependencies /project child-alpha pom.xml: project modelVersion4.0.0/modelVersion parent groupIdacme/groupId artifactIdacme-parent/artifactId version1/version /parent artifactIdchild-alpha/artifactId nameChild Alpha Project/name version1.0/version packagingjar/packaging scm.../scm properties.../properties build resources.../resources plugins.../plugins /build profiles profile idjdk15/id activation activeByDefaulttrue/activeByDefault jdk1.5/jdk /activation dependencies dependency groupIdacme/groupId artifactIdchild-dep-jdk15/artifactId version1.0/version /dependency /dependencies /profile /profiles dependencies.../dependencies /project child-dep-jdk15-1.0.pom: project modelVersion4.0.0/modelVersion parent groupIdacme/groupId artifactIdacme-parent/artifactId version1/version /parent groupIdacme/groupId artifactIdchild-dep-jdk15/artifactId nameAcme Child Dependency/name version1.0/version packagingjar/packaging build.../build dependencies.../dependencies /project
Re: DependencyResolutionException when upgrading from Maven 2.2.1 to Maven 3.0.4
Any thoughts from anyone about either Mike's issues, or mine? Can you boil it down to 5 sentences? I gave up and I'm sure everyone else did too. Sorry but that was just total information overload. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: DependencyResolutionException when upgrading from Maven 2.2.1 to Maven 3.0.4
If you add relativePath../pom.xml/relativePath Into the parent section of child-alpha, does it resolve any issue your having? Specifically with having to do mvn -N install on the parent 1st. On 11 April 2012 16:14, Brain Dump braindump2...@gmail.com wrote: I was able to compile with no problems on 2.2.1. The only pom.xml changes I had to make to get this (almost) working on 3.0.4 was to add version numbers for plugins that didn't have them specified, move plugins under reporting/reporting into build/build, and run mvn -N install on the parent pom -- although that's what I'm trying to avoid. I don't know if the issues you're running into are related, or caused by something else. Any thoughts from anyone about either Mike's issues, or mine? Thanks! On Tue, Apr 10, 2012 at 12:37 PM, mike digioia mpd...@gmail.com wrote: Hi, I just posted a similar issue I am having with the same kind of errors. Did you ever get this to compile on the 2.2.1? I have built two machines, one with 2.2.1 and the other one with 3.0.4. I have different problems with each. Main issue with 3.0.4 is it could not locate some of my dependency jars. So I copied them from the 2.2.1 release system. But still issues. The other main issue is using extension to java/javax with the jmdns.jar. So I modified the classes inside this jar to avoid the problem but still have issues. On the 2.2.1 system it does not see my jar, even though it is inside the pom and was successful with the mvn install-file command. On Tue, Apr 10, 2012 at 12:19 PM, Brain Dump braindump2...@gmail.com wrote: Hi everyone, I'm trying to upgrade my project from Maven 2.2.1 to Maven 3.0.4 but am running into problems with a dependency resolution. I spent a full day trying to research this by looking through Maven documentation and similar posts, but I'm still stuck. I posted on stackoverflow ( http://stackoverflow.com/q/10092772/1324379) but realized that this Maven User List might be a better place to ask for help. Hope that's okay, and thanks in advance for your help. My project structure is as follows: pom.xml (acme-parent) child-alpha +- pom.xml In addition, I have the following files in my own repository: http://maven.my-own-repo.com/acme/child-dep-jdk15/maven-metadata-local.xml http://maven.my-own-repo.com/acme/child-dep-jdk15/1.0/child-dep-jdk15-1.0.jar http://maven.my-own-repo.com/acme/child-dep-jdk15/1.0/child-dep-jdk15-1.0.pom child-alpha/pom.xml in turn has a profile dependency on my own acme:child-dep-jdk15, which has been separately built into a jar file and has its own .pom file specifying a parent that is the same acme-parent parent as child-alpha. Here are excerpts from the relevant files: acme-parent pom.xml: ?xml version=1.0 encoding=UTF-8? project modelVersion4.0.0/modelVersion groupIdacme/groupId artifactIdacme-parent/artifactId nameAcme Parent Project/name version1/version packagingpom/packaging properties.../properties modules modulechild-alpha/module /modules repositories repository idacme-repo/id urlhttp://maven.my-own-repo.com/url /repository repository idcentral/id urlhttp://repo1.maven.org/maven2/url /repository /repositories pluginRepositories.../pluginRepositories build plugins.../plugins /build dependencies.../dependencies /project child-alpha pom.xml: project modelVersion4.0.0/modelVersion parent groupIdacme/groupId artifactIdacme-parent/artifactId version1/version /parent artifactIdchild-alpha/artifactId nameChild Alpha Project/name version1.0/version packagingjar/packaging scm.../scm properties.../properties build resources.../resources plugins.../plugins /build profiles profile idjdk15/id activation activeByDefaulttrue/activeByDefault jdk1.5/jdk /activation dependencies dependency groupIdacme/groupId artifactIdchild-dep-jdk15/artifactId version1.0/version /dependency /dependencies /profile /profiles dependencies.../dependencies /project child-dep-jdk15-1.0.pom: project modelVersion4.0.0/modelVersion parent groupIdacme/groupId artifactIdacme-parent/artifactId version1/version
Re: DependencyResolutionException when upgrading from Maven 2.2.1 to Maven 3.0.4
Or start from scratch with simple pom.xml and nothing in src, then add src and fix dependencies, build up slowly then diff the resulting pom and see what's different. On 11 April 2012 16:25, John Patrick nhoj.patr...@gmail.com wrote: If you add relativePath../pom.xml/relativePath Into the parent section of child-alpha, does it resolve any issue your having? Specifically with having to do mvn -N install on the parent 1st. On 11 April 2012 16:14, Brain Dump braindump2...@gmail.com wrote: I was able to compile with no problems on 2.2.1. The only pom.xml changes I had to make to get this (almost) working on 3.0.4 was to add version numbers for plugins that didn't have them specified, move plugins under reporting/reporting into build/build, and run mvn -N install on the parent pom -- although that's what I'm trying to avoid. I don't know if the issues you're running into are related, or caused by something else. Any thoughts from anyone about either Mike's issues, or mine? Thanks! On Tue, Apr 10, 2012 at 12:37 PM, mike digioia mpd...@gmail.com wrote: Hi, I just posted a similar issue I am having with the same kind of errors. Did you ever get this to compile on the 2.2.1? I have built two machines, one with 2.2.1 and the other one with 3.0.4. I have different problems with each. Main issue with 3.0.4 is it could not locate some of my dependency jars. So I copied them from the 2.2.1 release system. But still issues. The other main issue is using extension to java/javax with the jmdns.jar. So I modified the classes inside this jar to avoid the problem but still have issues. On the 2.2.1 system it does not see my jar, even though it is inside the pom and was successful with the mvn install-file command. On Tue, Apr 10, 2012 at 12:19 PM, Brain Dump braindump2...@gmail.com wrote: Hi everyone, I'm trying to upgrade my project from Maven 2.2.1 to Maven 3.0.4 but am running into problems with a dependency resolution. I spent a full day trying to research this by looking through Maven documentation and similar posts, but I'm still stuck. I posted on stackoverflow ( http://stackoverflow.com/q/10092772/1324379) but realized that this Maven User List might be a better place to ask for help. Hope that's okay, and thanks in advance for your help. My project structure is as follows: pom.xml (acme-parent) child-alpha +- pom.xml In addition, I have the following files in my own repository: http://maven.my-own-repo.com/acme/child-dep-jdk15/maven-metadata-local.xml http://maven.my-own-repo.com/acme/child-dep-jdk15/1.0/child-dep-jdk15-1.0.jar http://maven.my-own-repo.com/acme/child-dep-jdk15/1.0/child-dep-jdk15-1.0.pom child-alpha/pom.xml in turn has a profile dependency on my own acme:child-dep-jdk15, which has been separately built into a jar file and has its own .pom file specifying a parent that is the same acme-parent parent as child-alpha. Here are excerpts from the relevant files: acme-parent pom.xml: ?xml version=1.0 encoding=UTF-8? project modelVersion4.0.0/modelVersion groupIdacme/groupId artifactIdacme-parent/artifactId nameAcme Parent Project/name version1/version packagingpom/packaging properties.../properties modules modulechild-alpha/module /modules repositories repository idacme-repo/id urlhttp://maven.my-own-repo.com/url /repository repository idcentral/id urlhttp://repo1.maven.org/maven2/url /repository /repositories pluginRepositories.../pluginRepositories build plugins.../plugins /build dependencies.../dependencies /project child-alpha pom.xml: project modelVersion4.0.0/modelVersion parent groupIdacme/groupId artifactIdacme-parent/artifactId version1/version /parent artifactIdchild-alpha/artifactId nameChild Alpha Project/name version1.0/version packagingjar/packaging scm.../scm properties.../properties build resources.../resources plugins.../plugins /build profiles profile idjdk15/id activation activeByDefaulttrue/activeByDefault jdk1.5/jdk /activation dependencies dependency groupIdacme/groupId artifactIdchild-dep-jdk15/artifactId version1.0/version /dependency /dependencies /profile /profiles
Re: DependencyResolutionException when upgrading from Maven 2.2.1 to Maven 3.0.4
Hey -- sorry about the information overload. I've seen other posts on other forums where people posted too little information and were asked to post their source code or run something on full debug, etc., so I tried to be complete. Didn't mean to overwhelm, and thanks for the responses. Simply said, the dependency child-dep-jdk15 was handled without a problem in Maven 2.2.1 but its presence causes Maven 3.0.4 to look for the parent POM in remote repositories. Both child-alpha and child-dep-jdk15 have the same parent. The dependency child-dep-jdk15 was separately compiled and available on our own remote repository. I did try adding relativePath../pom.xml/relativePath to the parent section of child-alpha, and that had no effect. The only two things that I've managed to do to get the build to succeed is to (1) remove the dependency listed within profiles/profiles of child-alpha, or (2) first run mvn -N install on the parent first. So it seems that the presence of the dependency is what's causing the problem, but I don't understand why. (I haven't tried starting from scratch yet.) Neither option above is okay because I need that dependency, and running mvn -N install would be complicated for branching and our continuous integration server. *From: *Wayne Fay wayne...@gmail.com *To: *Maven Users List users@maven.apache.org *Sent: *Wednesday, April 11, 2012 8:21:44 AM *Subject: *Re: DependencyResolutionException when upgrading from Maven 2.2.1 to Maven 3.0.4 Any thoughts from anyone about either Mike's issues, or mine? Can you boil it down to 5 sentences? I gave up and I'm sure everyone else did too. Sorry but that was just total information overload. Wayne On Wed, Apr 11, 2012 at 8:27 AM, John Patrick nhoj.patr...@gmail.comwrote: Or start from scratch with simple pom.xml and nothing in src, then add src and fix dependencies, build up slowly then diff the resulting pom and see what's different. On 11 April 2012 16:25, John Patrick nhoj.patr...@gmail.com wrote: If you add relativePath../pom.xml/relativePath Into the parent section of child-alpha, does it resolve any issue your having? Specifically with having to do mvn -N install on the parent 1st.
Re: DependencyResolutionException when upgrading from Maven 2.2.1 to Maven 3.0.4
I've managed to do to get the build to succeed is to (1) remove the dependency listed within profiles/profiles of child-alpha, or (2) first For a ton of reasons, including a dependency in a profile is a really terrible thing to do. The very first thing I would do would be to remove it. In fact, I'd do everything I could to remove the use of profiles from your build entirely. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: DependencyResolutionException when upgrading from Maven 2.2.1 to Maven 3.0.4
Just to see if it would work, I moved the child-dep-jdk15 dependency out of profiles and moved it into dependencies/dependencies (outside of profiles). It still fails with the same stack trace. Any idea why? I can get the build to pass if I leave out that dependency altogether, but that's not really an option without significant code rewriting. I'm also curious about why including a dependency in a profile is not a good idea (as is using profiles at all). I'm working on a large codebase and would need to explain to the rest of the team before making such changes. Where can I read up on best practices about this? On Wed, Apr 11, 2012 at 1:29 PM, Wayne Fay wayne...@gmail.com wrote: I've managed to do to get the build to succeed is to (1) remove the dependency listed within profiles/profiles of child-alpha, or (2) first For a ton of reasons, including a dependency in a profile is a really terrible thing to do. The very first thing I would do would be to remove it. In fact, I'd do everything I could to remove the use of profiles from your build entirely. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: DependencyResolutionException when upgrading from Maven 2.2.1 to Maven 3.0.4
Brian, You can find detail in the manual - What do we mean by different build environments? Two example build environments are production and devel- opment. When you are working in a development environment, your system might be configured to read from a development database instance running on your local machine while in production, your system is configured to read from the production database. Maven allows you to define any number of build environments (build profiles) which can override any of the settings in the pom.xml. You could configure your application to read from your local, development instance of a database in your development profile, and you can configure it to read from the production database in the production profile. Profiles can also be activated by the environment and platform, you can customize a build to run differently depending the Operating System or the installed JDK version. Before we talk about using and configuring Maven profiles, we need to define the concept of Build Portability. * I don't see anything wrong with their use to fix the many current issues with using this system in very different industry/commercial settings On Wed, Apr 11, 2012 at 2:48 PM, Brain Dump braindump2...@gmail.com wrote: Just to see if it would work, I moved the child-dep-jdk15 dependency out of profiles and moved it into dependencies/dependencies (outside of profiles). It still fails with the same stack trace. Any idea why? I can get the build to pass if I leave out that dependency altogether, but that's not really an option without significant code rewriting. I'm also curious about why including a dependency in a profile is not a good idea (as is using profiles at all). I'm working on a large codebase and would need to explain to the rest of the team before making such changes. Where can I read up on best practices about this? On Wed, Apr 11, 2012 at 1:29 PM, Wayne Fay wayne...@gmail.com wrote: I've managed to do to get the build to succeed is to (1) remove the dependency listed within profiles/profiles of child-alpha, or (2) first For a ton of reasons, including a dependency in a profile is a really terrible thing to do. The very first thing I would do would be to remove it. In fact, I'd do everything I could to remove the use of profiles from your build entirely. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: DependencyResolutionException when upgrading from Maven 2.2.1 to Maven 3.0.4
Profiles per-se are “ok” Adding dependencies in a profile is not. The problem is when do those profiles get activated, and hence when will the dependencies get pulled in. When people have profiles activated by the presence of a file, and then that pom is resolved from the local repo and not from the checkout... then the file will not be in ~/.m2/repository/.../.../.../ so the profile will not be activated, and hence the dependency is lost. When people have profiles activated by the presence of a system property, and then the pom is resolved by a different build where the system property is not defined, the dependency will go missing. When people have profiles activated by a specific OS or JDK and then you build e.g. a WAR file that depends on it with one JDK, then the WAR file will only work for that JDK. Every time somebody tries adding a dependency via a profile, it comes back to shoot a downstream consumer of the pom in the ass. It was a mistake to allow (transitive scoped) dependencies in profiles in the first place. BTW a similar sin is using properties to define dependency coordinates and using profiles to change those properties. I suspect non-transitive dependencies (i.e. scope=test or provided) in profiles *might* have one or two valid use cases... but you would *REALLY* need to be sure you knew what exactly you were doing and why, and I would fight tooth and nail to avoid needing to go down that road. -Stephen On 11 April 2012 23:22, mike digioia mpd...@gmail.com wrote: Brian, You can find detail in the manual - What do we mean by different build environments? Two example build environments are production and devel- opment. When you are working in a development environment, your system might be configured to read from a development database instance running on your local machine while in production, your system is configured to read from the production database. Maven allows you to define any number of build environments (build profiles) which can override any of the settings in the pom.xml. You could configure your application to read from your local, development instance of a database in your development profile, and you can configure it to read from the production database in the production profile. Profiles can also be activated by the environment and platform, you can customize a build to run differently depending the Operating System or the installed JDK version. Before we talk about using and configuring Maven profiles, we need to define the concept of Build Portability. * I don't see anything wrong with their use to fix the many current issues with using this system in very different industry/commercial settings On Wed, Apr 11, 2012 at 2:48 PM, Brain Dump braindump2...@gmail.com wrote: Just to see if it would work, I moved the child-dep-jdk15 dependency out of profiles and moved it into dependencies/dependencies (outside of profiles). It still fails with the same stack trace. Any idea why? I can get the build to pass if I leave out that dependency altogether, but that's not really an option without significant code rewriting. I'm also curious about why including a dependency in a profile is not a good idea (as is using profiles at all). I'm working on a large codebase and would need to explain to the rest of the team before making such changes. Where can I read up on best practices about this? On Wed, Apr 11, 2012 at 1:29 PM, Wayne Fay wayne...@gmail.com wrote: I've managed to do to get the build to succeed is to (1) remove the dependency listed within profiles/profiles of child-alpha, or (2) first For a ton of reasons, including a dependency in a profile is a really terrible thing to do. The very first thing I would do would be to remove it. In fact, I'd do everything I could to remove the use of profiles from your build entirely. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
DependencyResolutionException when upgrading from Maven 2.2.1 to Maven 3.0.4
Hi everyone, I'm trying to upgrade my project from Maven 2.2.1 to Maven 3.0.4 but am running into problems with a dependency resolution. I spent a full day trying to research this by looking through Maven documentation and similar posts, but I'm still stuck. I posted on stackoverflow ( http://stackoverflow.com/q/10092772/1324379) but realized that this Maven User List might be a better place to ask for help. Hope that's okay, and thanks in advance for your help. My project structure is as follows: pom.xml (acme-parent) child-alpha +- pom.xml In addition, I have the following files in my own repository: http://maven.my-own-repo.com/acme/child-dep-jdk15/maven-metadata-local.xml http://maven.my-own-repo.com/acme/child-dep-jdk15/1.0/child-dep-jdk15-1.0.jar http://maven.my-own-repo.com/acme/child-dep-jdk15/1.0/child-dep-jdk15-1.0.pom child-alpha/pom.xml in turn has a profile dependency on my own acme:child-dep-jdk15, which has been separately built into a jar file and has its own .pom file specifying a parent that is the same acme-parent parent as child-alpha. Here are excerpts from the relevant files: acme-parent pom.xml: ?xml version=1.0 encoding=UTF-8? project modelVersion4.0.0/modelVersion groupIdacme/groupId artifactIdacme-parent/artifactId nameAcme Parent Project/name version1/version packagingpom/packaging properties.../properties modules modulechild-alpha/module /modules repositories repository idacme-repo/id urlhttp://maven.my-own-repo.com/url /repository repository idcentral/id urlhttp://repo1.maven.org/maven2/url /repository /repositories pluginRepositories.../pluginRepositories build plugins.../plugins /build dependencies.../dependencies /project child-alpha pom.xml: project modelVersion4.0.0/modelVersion parent groupIdacme/groupId artifactIdacme-parent/artifactId version1/version /parent artifactIdchild-alpha/artifactId nameChild Alpha Project/name version1.0/version packagingjar/packaging scm.../scm properties.../properties build resources.../resources plugins.../plugins /build profiles profile idjdk15/id activation activeByDefaulttrue/activeByDefault jdk1.5/jdk /activation dependencies dependency groupIdacme/groupId artifactIdchild-dep-jdk15/artifactId version1.0/version /dependency /dependencies /profile /profiles dependencies.../dependencies /project child-dep-jdk15-1.0.pom: project modelVersion4.0.0/modelVersion parent groupIdacme/groupId artifactIdacme-parent/artifactId version1/version /parent groupIdacme/groupId artifactIdchild-dep-jdk15/artifactId nameAcme Child Dependency/name version1.0/version packagingjar/packaging build.../build dependencies.../dependencies /project When I tried to build child-alpha (while in the child-alpha directory), I ran the following command: mvn -U -e clean install And I got the following log messages and stack trace (extraneous messages removed): Downloading: http://maven2.my-own-repo.com/acme/acme-parent/1/acme-parent-1.pom Downloading: http://repo1.maven.org/maven2/acme/acme-parent/1/acme-parent-1.pom [...] [ERROR] Failed to execute goal on project child-alpha: Could not resolve dependencies for project acme:child-alpha:jar:1.0: [...] Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project acme:child-alpha:jar:1.0: [...] Caused by: org.sonatype.aether.collection.DependencyCollectionException: Failed to collect dependencies for [...] at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:258) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:308) at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:150) ... 23 more Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for acme:child-dep-jdk15:jar:1.0 at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:331) at
Re: DependencyResolutionException when upgrading from Maven 2.2.1 to Maven 3.0.4
Hi, I just posted a similar issue I am having with the same kind of errors. Did you ever get this to compile on the 2.2.1? I have built two machines, one with 2.2.1 and the other one with 3.0.4. I have different problems with each. Main issue with 3.0.4 is it could not locate some of my dependency jars. So I copied them from the 2.2.1 release system. But still issues. The other main issue is using extension to java/javax with the jmdns.jar. So I modified the classes inside this jar to avoid the problem but still have issues. On the 2.2.1 system it does not see my jar, even though it is inside the pom and was successful with the mvn install-file command. On Tue, Apr 10, 2012 at 12:19 PM, Brain Dump braindump2...@gmail.comwrote: Hi everyone, I'm trying to upgrade my project from Maven 2.2.1 to Maven 3.0.4 but am running into problems with a dependency resolution. I spent a full day trying to research this by looking through Maven documentation and similar posts, but I'm still stuck. I posted on stackoverflow ( http://stackoverflow.com/q/10092772/1324379) but realized that this Maven User List might be a better place to ask for help. Hope that's okay, and thanks in advance for your help. My project structure is as follows: pom.xml (acme-parent) child-alpha +- pom.xml In addition, I have the following files in my own repository: http://maven.my-own-repo.com/acme/child-dep-jdk15/maven-metadata-local.xml http://maven.my-own-repo.com/acme/child-dep-jdk15/1.0/child-dep-jdk15-1.0.jar http://maven.my-own-repo.com/acme/child-dep-jdk15/1.0/child-dep-jdk15-1.0.pom child-alpha/pom.xml in turn has a profile dependency on my own acme:child-dep-jdk15, which has been separately built into a jar file and has its own .pom file specifying a parent that is the same acme-parent parent as child-alpha. Here are excerpts from the relevant files: acme-parent pom.xml: ?xml version=1.0 encoding=UTF-8? project modelVersion4.0.0/modelVersion groupIdacme/groupId artifactIdacme-parent/artifactId nameAcme Parent Project/name version1/version packagingpom/packaging properties.../properties modules modulechild-alpha/module /modules repositories repository idacme-repo/id urlhttp://maven.my-own-repo.com/url /repository repository idcentral/id urlhttp://repo1.maven.org/maven2/url /repository /repositories pluginRepositories.../pluginRepositories build plugins.../plugins /build dependencies.../dependencies /project child-alpha pom.xml: project modelVersion4.0.0/modelVersion parent groupIdacme/groupId artifactIdacme-parent/artifactId version1/version /parent artifactIdchild-alpha/artifactId nameChild Alpha Project/name version1.0/version packagingjar/packaging scm.../scm properties.../properties build resources.../resources plugins.../plugins /build profiles profile idjdk15/id activation activeByDefaulttrue/activeByDefault jdk1.5/jdk /activation dependencies dependency groupIdacme/groupId artifactIdchild-dep-jdk15/artifactId version1.0/version /dependency /dependencies /profile /profiles dependencies.../dependencies /project child-dep-jdk15-1.0.pom: project modelVersion4.0.0/modelVersion parent groupIdacme/groupId artifactIdacme-parent/artifactId version1/version /parent groupIdacme/groupId artifactIdchild-dep-jdk15/artifactId nameAcme Child Dependency/name version1.0/version packagingjar/packaging build.../build dependencies.../dependencies /project When I tried to build child-alpha (while in the child-alpha directory), I ran the following command: mvn -U -e clean install And I got the following log messages and stack trace (extraneous messages removed): Downloading: http://maven2.my-own-repo.com/acme/acme-parent/1/acme-parent-1.pom Downloading: http://repo1.maven.org/maven2/acme/acme-parent/1/acme-parent-1.pom [...] [ERROR] Failed to execute goal on project child-alpha: Could not resolve dependencies for project acme:child-alpha:jar:1.0: [...] Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project acme:child-alpha:jar:1.0: [...] Caused by: