Why does my framework structure sometimes select the oss-parent dependency?

I have a server that automatically builds a project 2.3.4 for the play platform and can successfully build my development branch. However, when I create another branch using the same script on the same server, I get strange behavior.

For some reason, the assembly selects dependencies called [actual dependency]-parent , which does not happen in another branch, and when I create a problem branch on my local machine.

For instance:

At my local level:

 [info] Resolving org.elasticsearch#elasticsearch;1.4.0 ... [info] Resolving org.apache.lucene#lucene-core;4.10.2 ... [info] Resolving org.apache.lucene#lucene-analyzers-common;4.10.2 ... [info] Resolving org.apache.lucene#lucene-queries;4.10.2 ... [info] Resolving org.apache.lucene#lucene-memory;4.10.2 ... [info] Resolving org.apache.lucene#lucene-highlighter;4.10.2 ... ... 

In CI build:

 [info] Resolving org.elasticsearch#elasticsearch;1.4.0 ... [info] Resolving org.sonatype.oss#oss-parent;7 ... [info] Resolving org.apache.lucene#lucene-core;4.10.2 ... [info] Resolving org.apache.lucene#lucene-parent;4.10.2 ... [info] Resolving org.apache.lucene#lucene-solr-grandparent;4.10.2 ... [info] Resolving org.apache#apache;13 ... [info] Resolving org.apache.lucene#lucene-analyzers-common;4.10.2 ... [info] Resolving org.apache.lucene#lucene-parent;4.10.2 ... [info] Resolving org.apache.lucene#lucene-queries;4.10.2 ... [info] Resolving org.apache.lucene#lucene-parent;4.10.2 ... [info] Resolving org.apache.lucene#lucene-memory;4.10.2 ... [info] Resolving org.apache.lucene#lucene-parent;4.10.2 ... [info] Resolving org.apache.lucene#lucene-highlighter;4.10.2 ... [info] Resolving org.apache.lucene#lucene-parent;4.10.2 ... ... 

The org.sonatype.oss#oss-parent;7 dependency is completely new, there is no org.sonatype.oss dependency in the working assembly.

This is followed by tests with an error after the inability to run a fake application, which, I believe, is associated with bad dependencies.

Does anyone know what might cause this?

Here's what the converters look like in my build.sbt:

 resolvers := Seq( "Sonatype repo" at "https://oss.sonatype.org/content/repositories/releases/", "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/", "Maven central repo" at "https://oss.sonatype.org/content/repositories/central/", "Maven central repo2" at "https://repo1.maven.org/maven2/", "Typesafe Repository" at "https://repo.typesafe.com/typesafe/releases/", Resolver.url("Objectify Play Repository", url("http://schaloner.imtqy.com/releases/"))(Resolver.ivyStylePatterns), Resolver.url("Objectify Play Snapshot Repository", url("http://schaloner.imtqy.com/snapshots/"))(Resolver.ivyStylePatterns), Resolver.url("Edulify Repository", url("http://edulify.imtqy.com/modules/releases/"))(Resolver.ivyStylePatterns), Resolver.file("Local Repository", file(sys.env.get("PLAY_HOME").map(_ + "/repository/local").getOrElse("")))(Resolver.ivyStylePatterns), Resolver.mavenLocal ) 

This morning, February 6, 2015, the two branches were merged, so there are no differences. However, one branch is still building, and the other is failing (in the same elastic case). Each assembly has its own activator instance and does not have shared repository folders, but the two repository folders are the same.

+5
source share
1 answer

The main reason is probably because the repossession of oss.sonatype.org was migrated from http to https not so long ago, so sbt is trying to get this dependency on https by receiving 301 redirects and cracking it. I suspect the reason you don't see this on your local server is because you have a cached version, maybe?

I think one of two approaches will help you overcome this:

  • If you have access to your CI server maven repository, try copying the correct dependency from the local maven repository (after deleting the current cached version, if any). Usually this will be in the home directory of any user who starts the CI server or the build process, in ~ / .m2 / repository / org / sonatype / oss / oss-parent / 7

    I recommend deleting the entire directory (if any) and copying this entire directory from your local well-known copy.

  • If this does not work or is not possible, you might consider adding the correct https sonata-type repository URL, which in sbt will look something like this:

     resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots" 

    in the corresponding part of your Build.scala ... but you may still need to delete the directory of any corrupted cached version if it exists and is saved in assemblies.

+3
source

Source: https://habr.com/ru/post/1212425/


All Articles