Can SBT only allow .pom files as dependencies without jars?

So, as the name suggests, can sbtresolve.pom file dependencies that only contain configurations / properties and have no .jar file associated with it?

I am currently developing a new frontend app using Play! Frame and corner. Here's the script:

  • Root project (build / deployment).

    • Main business module - pom.xml
    • Web Modules - pom.xml

      • Rest API-pom.xml
        • Module - pom.xml
        • Module - pom.xml
      • Frontend (SBT build, multi-module project)

        • Mod1 - build.sbt
        • Mod2 - build.sbt (depends on mod1)
          • Additional modules inside - build.sbt

        build.sbt

        Project / build.scala

    • Web Commons (used in the Restore and Frontend API) - pom.xml

The sbt compilation is done via maven with a plugin, sbt-launcher if im not wrong. Everything works and compiles as expected, however we ran into a problem when we added WebCommons as a dependency in the frontend build.sbt file. The problem is that the root pom.xml file has its own parent, allows you to name it X, and X contains several .pom files that delegate child modules (in this case, the root project) config / properties / dependencies which are needed to facilitate packaging RPM. By running maven clean install, the compilation process goes fine, we get the interface, and the sbt compilation cycle starts as expected. When sbt tries to resolve an internet community dependency, it also resolves each parent. In this case, web-commons-> web-modules-> root-> X.When it reaches X, it finds that there are several dependencies with it (not important for the interface at all ...), but they are made from .pom files, not jar's. These .pom files are loaded correctly with the converters, but then sbt looks for the matching .jar files taking a huge amount of time to complete the build, and when it does, errors, errors are everywhere (missing dependencies). I've tried several possible solutions:I've tried several possible solutions:I've tried several possible solutions:

1. intransitive () depending on internet resources, not efficient, still trying to find parents. 2. exclude (organization, filename *) , again ineffective.
3. excludeAll (ExclusionRule (org, dep1) ExclusionRule (org, dep2) ...) , is unfortunately not efficient.

I am currently using sbt 0.13.2 / 6 (tried both). The next step was to define ivy.xml and ivysettings.xml, which sets up this dependency and forces type = pom. Could this work? Any other way / workaround?

Thanks in advance.

+3


source to share


1 answer


Hopefully good news for you!

I recently had a similar problem with SBT 0.13.13 where I have two projects, each posting a POM file (no jars!) Where one of the POMs depends on the other.

Adding a dependency to the POM in the * .sbt file looks like this:

libraryDependencies += 
  "<org>"
  % "<artifact>" 
  % "<version pattern>" 
  artifacts
  Artifact("<artifact>", `type`="pom", extension="pom")

      

If you are interested in an example, see here:



https://github.com/TIWG/com.nomagic.magicdraw.sysml.plugin/blob/release/18.0-sp6/build.sbt#L63

The POM is published here:

https://bintray.com/tiwg/org.omg.tiwg.vendor.nomagic/com.nomagic.magicdraw.sysml.plugin/18.0-sp6.2

That the POM has a dependency on another POM posted here:

https://bintray.com/tiwg/org.omg.tiwg.vendor.nomagic/com.nomagic.magicdraw.package/18.0-sp6.2

0


source







All Articles