1

I can configure my Grails app to pull from my company's Archiva repo using:

grails.project.dependency.resolution = {
    repositories {
        mavenRepo "https://repo.mycompany.com/archiva/repository/internal/"

However, this doesn't quite work right, because I also need to pull a couple of snapshot versions of artifacts which are located in a slightly different location. So if I include the above, all artifacts resolve except for the snapshots. However, if I include the below code:

mavenRepo "https://repo.mycompany.com/archiva/repository/snapshot/"

then all the snapshot artifacts are resolved, however (as you would expect) none of the release artifacts get resolved. So obviously the solution is to include both, however that is not working either. If I do:

mavenRepo "https://repo.mycompany.com/archiva/repository/internal/"
mavenRepo "https://repo.mycompany.com/archiva/repository/snapshot/"

Then the snapshots don't resolve, and additionally some of the release artifacts don't resolve either (but some do). How are you supposed to configure multiple custom repo locations in Grails? I'm using Grails 2.5.1

Steven Byks
  • 125
  • 5
  • 1
    https://github.com/grails-samples/grails-website/blob/master/grails-app/conf/BuildConfig.groovy what you have seems correct. I wonder if there is some form of other conflict. Same package /folder name causing issue. As a test I would create a 3rd location that has a combination of both repository then only enable that 1 mavenRepo containing all see if issue is still there – V H Jun 08 '16 at 21:58
  • "As a test I would create a 3rd location that has a combination of both repository" So to do that, I'd have to setup a server with Archiva or Artifactory or something on it? Also, I realized that as a work around, I could maybe build the snapshot artifact locally, but with a release version, and then install that to my local ivy cache. Really, this artifact should be in our repo with a release version anyway... However, I can't get that to work correctly either, but that's a whole separate question. – Steven Byks Jun 09 '16 at 15:29
  • 1
    "setup a server with Archiva or Artifactory or something on it" ? would you ? Isnt a repo just files and folders ? So an apache server that has enabled directory Listing (to show folder views) then to upload a package that exists in both locations to it. So the contents even a specific version from repo.m.com/archiva/repository/internal/xyz and repo.m.com/archiva/repository/snapshot/xyz into demo.m.com/repo -- > this then has a folder called xyz that has the containing folders that you would see under internal and under snap shot if you went browsing the folders through browser – V H Jun 09 '16 at 15:43
  • I already had Apache running, so I tried to setup a repo that way. I copied the files from ~/.grails/ivy-cache to my apache folder, and that worked... except that was actually from an older copy of grails and it didn't have all the files in it. Which is weird since that is the default location, however my current installation isn't using that folder. As a test, I moved all the files out of there, and did a clean compile run-app from the command line. The app ran fine, but the ivy-cache is still empty. I think I just have to wait for the release artifact to get added to our official repo. – Steven Byks Jun 10 '16 at 13:32

0 Answers0