1

I'm using Gradle 2.7 and Maven 3.2.1 on 64-bit Windows 7

Setup: ProjectA depends on projectB and projectB resides in a local maven repository, C:\Users\Carlos\vagrant.m2\repository..[projectB .pom and .war files]

Problem: While building project A:

* What went wrong:
Execution failed for task ':stage'.
> Could not resolve all dependencies for configuration ':webapp'.
   > Could not find [projectB].
     Searched in the following locations:
         ...
         file:/home/vagrant/.m2/repository/../[projectB].pom
         file:/home/vagrant/.m2/repository/../[projectB].war
         Required by:
         [projectA]

Goal: How do I make projectA "see" projectB? From the error message above, it seems that projectB.pom and projectB.war do not exist in the filesystem.

What I've tried: Changing maven local repository default location in C:/Users/Carlos/.m2/settings.xml:

<settings>
  <localRepository>C:/Users/Carlos/vagrant/.m2/repository</localRepository>
</settings>

and, in projectA:

...
repositories {
    mavenLocal()
    ...
}

and projectB files are C:/Users/Carlos/vagrant/.m2/repository/.../projectB.pom and C:/Users/Carlos/vagrant/.m2/repository/.../projectB.war

  • If you uncomment the solr dependency in project A, does it work? I suspect your dependency has nothing to do with your issue. – Daniel Bickler Jun 19 '17 at 18:48
  • Yes, but I don't think projectA depends on Solr directly. Is there a command to help verify whether projectA depends on Solr? – Carlos Vera Jun 19 '17 at 18:57
  • Not that I'm aware of, you'll have to analyze the code of Project A and see if it uses anything from Solr. – Daniel Bickler Jun 19 '17 at 18:59
  • Daniel, about your first questoin, after a gradle clean, uncommenting the solr dependency in projectA causes gradle build to fail in a similar way – Carlos Vera Jun 21 '17 at 15:50
  • So the problem seems to have nothing to do with the solr dependency? For some reason your Gradle configuration can't find projectB from projectA. – Daniel Bickler Jun 21 '17 at 15:55
  • Yes, I think it has nothing to do with the Solr dependency then. I double checked that projectB's .war and .pom are in the correct locations (/home/vagrant/.m2/../). – Carlos Vera Jun 21 '17 at 17:19
  • As it stands, I think you need to edit your question to reflect it has nothing to do with solr and to provide us with just the information necessary. It will help if you can provide us with the pertinent parts of your file structure and gradle files. – Daniel Bickler Jun 21 '17 at 17:36

0 Answers0