Scala/SBT project: com.sikulix::sikulixapi::1.1.x pom not working

Bug #1558322 reported by Ethan on 2016-03-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sikuli
Undecided
RaiMan

Bug Description

While trying to pull in dependencies for the sikulixapi (in both 1.1.0 and 1.1.1 as well as in the snapshots) I run into what seems to be the same problem across the board. It seems to be related to an issue that appears to be in the pom.

Here's an example from the sonatype repo.

In the pom file located here

https://oss.sonatype.org/content/groups/public/com/sikulix/sikulixapi/1.1.0/sikulixapi-1.1.0.pom

There seem to be some place holder variables that are not being resolved when the pom is produced. for example ->

  <dependency>
    <groupId>com.sikulix</groupId>
    <artifactId>${sikulix.libs}</artifactId>
    <version>${project.version}</version>
  </dependency>
</dependencies>
<properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties>
<distributionManagement>
  <repository>
    <id>sikulix.deploy</id>
    <url>${sikulix.deploy.target}</url>
  </repository>
</distributionManagement>

This isn't the only pom with this problem and it seems to be for these same places (the ${sikulix.libs} is what pops up as an error with whatever I try to pull down from maven, regardless if I try with snapshots or with 1.1.0 or with 1.1.1 or whatever).

description: updated
RaiMan (raimund-hocke) wrote :
Download full text (3.4 KiB)

--- While trying to pull in dependencies for the sikulixapi
... not sure, what you are doing here, but ...

having a Maven project with this pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.sikulix</groupId>
    <artifactId>MavenTest</artifactId>
    <version>2.0.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
    </properties>
    <dependencies>
      <dependency>
        <groupId>com.sikulix</groupId>
        <artifactId>sikulixapi</artifactId>
        <version>1.1.0</version>
      </dependency>
    </dependencies>
</project>

simply works as expected:
------------------------------------------------------------------------
Building MavenTest 2.0.0-SNAPSHOT
------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/com/sikulix/sikulixapi/1.1.0/sikulixapi-1.1.0.pom

Downloaded: http://repo.maven.apache.org/maven2/com/sikulix/sikulixapi/1.1.0/sikulixapi-1.1.0.pom (6 KB at 5.7 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/com/sikulix/sikulixlibsmac/1.1.0/sikulixlibsmac-1.1.0.pom

Downloaded: http://repo.maven.apache.org/maven2/com/sikulix/sikulixlibsmac/1.1.0/sikulixlibsmac-1.1.0.pom (3 KB at 15.7 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/com/sikulix/sikulixapi/1.1.0/sikulixapi-1.1.0.jar
Downloading: http://repo.maven.apache.org/maven2/com/sikulix/sikulixlibsmac/1.1.0/sikulixlibsmac-1.1.0.jar

Downloaded: http://repo.maven.apache.org/maven2/com/sikulix/sikulixapi/1.1.0/sikulixapi-1.1.0.jar (1107 KB at 868.1 KB/sec)

Downloaded: http://repo.maven.apache.org/maven2/com/sikulix/sikulixlibsmac/1.1.0/sikulixlibsmac-1.1.0.jar (4853 KB at 1173.9 KB/sec)

--- maven-clean-plugin:2.4.1:clean (default-clean) @ MavenTest ---

--- maven-resources-plugin:2.5:resources (default-resources) @ MavenTest ---
[debug] execute contextualize
Using 'UTF-8' encoding to copy filtered resources.
Copying 1 resource

--- maven-compiler-plugin:2.3.2:compile (default-compile) @ MavenTest ---
Compiling 1 source file to /Users/raimundhocke/NetBeansProjects/MavenTest/target/classes

--- ${sikulix.libs}
this is resolved during Maven processing by the section:
 <profiles>
  <profile>
   <id>Windows</id>
   <activation>
    <os>
     <family>windows</family>
    </os>
   </activation>
   <properties>
    <sikulix.libs>sikulixlibswin</sikulix.libs>
   </properties>
  </profile>
  <profile>
   <id>Unix</id>
   <activation>
    <os>
     <family>unix</family>
    </os>
   </activation>
   <properties>
    <sikulix.libs>sikulixlibslux</sikulix.libs>
   </properties>
  </profile>
  <profile>
   <id>Mac</id>
   <activation>
    <os>
     <family>mac</family>
    </os>
   </...

Read more...

Changed in sikuli:
status: New → Opinion
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.1
Ethan (supercriticalfluid) wrote :

I'm trying to pull in Sikulixapi for use in a Scala SBT project and I keep getting failures to grab the dependencies.

I really don't know much at all about Maven or Ivy, and am still very new at SBT. I'm guessing there must be some difference between how SBT/Ivy is interacting with the profiles that's throwing things off.

I'll look into it.

In the mean time thanks for the prompt reply. Sikuli is quite impressive. I got to toy around with it a few years ago using the Clojure wrapper and I'm just trying to get to the point where I can use the API again from Scala.

You're doing a great work. In some ways Sikuli has played a part in getting me into my programming career, so thanks for that as well.

RaiMan (raimund-hocke) wrote :

thanks for feedback and details.

any information or insights are welcome.
I will have a deeper look into it tomorrow.

summary: - pom in sonatype repo seems to not have a place holder being replaced
+ Scala/SBT project: sikulixapi::1.1.x pom not working
summary: - Scala/SBT project: sikulixapi::1.1.x pom not working
+ Scala/SBT project: com.sikulix::sikulixapi::1.1.x pom not working
Ethan (supercriticalfluid) wrote :
Download full text (78.8 KiB)

Here's what I get from sbt when I try and simply pull in sikulixapi 1.1.0 through SBT with the following build.sbt

scalaVersion := "2.11.8"

libraryDependencies ++= {
  Seq(
    "com.sikulix" % "sikulixapi" % "1.1.0"
  )
}

[debug] :: resolving dependencies :: default#sikutrial_2.11;1.0
[debug] confs: [compile, runtime, test, provided, optional, compile-internal, runtime-internal, test-internal, plugin, sources, docs, pom, scala-tool]
[debug] validate = true
[debug] refresh = false
[debug] resolving dependencies for configuration 'compile'
[debug] == resolving dependencies for default#sikutrial_2.11;1.0 [compile]
[debug] == resolving dependencies default#sikutrial_2.11;1.0->org.scala-lang#scala-library;2.11.8 [compile->default(compile)]
[info] Resolving org.scala-lang#scala-library;2.11.8 ...
[debug] sbt-chain: Checking cache for: sbt.ivyint.MergedDescriptors@60a3d4e7
[debug] sbt-chain: module revision found in cache: org.scala-lang#scala-library;2.11.8
[debug] found org.scala-lang#scala-library;2.11.8 in sbt-chain
[debug] [2.11.8] org.scala-lang#scala-library;2.11.8
[debug] == resolving dependencies default#sikutrial_2.11;1.0->org.scala-lang#scala-library;2.11.8 [compile->runtime]
[debug] == resolving dependencies default#sikutrial_2.11;1.0->org.scala-lang#scala-library;2.11.8 [compile->compile]
[debug] == resolving dependencies default#sikutrial_2.11;1.0->org.scala-lang#scala-library;2.11.8 [compile->master]
[debug] == resolving dependencies default#sikutrial_2.11;1.0->com.sikulix#sikulixapi;1.1.0 [compile->default(compile)]
[info] Resolving com.sikulix#sikulixapi;1.1.0 ...
[debug] sbt-chain: Checking cache for: dependency: com.sikulix#sikulixapi;1.1.0 {compile=[default(compile)]}
[debug] sbt-chain: module revision found in cache: com.sikulix#sikulixapi;1.1.0
[debug] found com.sikulix#sikulixapi;1.1.0 in sbt-chain
[debug] == resolving dependencies default#sikutrial_2.11;1.0->com.sikulix#sikulixapi;1.1.0 [compile->runtime]
[debug] == resolving dependencies default#sikutrial_2.11;1.0->com.sikulix#sikulixapi;1.1.0 [compile->compile]
[debug] == resolving dependencies com.sikulix#sikulixapi;1.1.0->commons-cli#commons-cli;1.2 [compile->master(compile)]
[info] Resolving commons-cli#commons-cli;1.2 ...
[debug] sbt-chain: Checking cache for: dependency: commons-cli#commons-cli;1.2 {compile=[compile(*), master(compile)], runtime=[runtime(*)]}
[debug] sbt-chain: module revision found in cache: commons-cli#commons-cli;1.2
[debug] found commons-cli#commons-cli;1.2 in sbt-chain
[debug] == resolving dependencies com.sikulix#sikulixapi;1.1.0->commons-cli#commons-cli;1.2 [compile->compile(*)]
[debug] == resolving dependencies com.sikulix#sikulixapi;1.1.0->commons-cli#commons-cli;1.2 [compile->runtime(*)]
[debug] == resolving dependencies com.sikulix#sikulixapi;1.1.0->commons-cli#commons-cli;1.2 [compile->compile]
[debug] == resolving dependencies com.sikulix#sikulixapi;1.1.0->org.apache.commons#commons-exec;1.3 [compile->master(compile)]
[info] Resolving org.apache.commons#commons-exec;1.3 ...
[debug] sbt-chain: Checking cache for: dependency: org.apache.commons#commons-exec;1.3 {compile=[compile(*),...

Ethan (supercriticalfluid) wrote :

So I found a seemingly related issue and I posted in the sbt-dev google group where I found it and someone was mentioning that it looked like it would be an Ivy issue, since SBT relies on Ivy rather than Maven. The only thing I'm too green to know is whether it's a bug or feature of Ivy.

https://groups.google.com/forum/#!topic/sbt-dev/mO4n7FR2icQ

I'm trying to learn as quickly about SBT and Ivy as I can, but starting to wonder if, for the sake of timeliness in my project, some manual work around might not be presently easier than trying to resolve this, though I imagine I could learn a great deal about POMs, Ivy and SBT looking for the answer I do need to get moving on a solution.

If you have any recommendations beyond this, I'd appreciate it.

I'm not sure how you'd treat this, if you'd try and do some kind of work around, or if I'd just need to dig into Ivy and see if they should be handling this or if it's simply against the grain of the design philosophy of Ivy.

I'm out of my depth. But thought I'd at least place a link here on this in case it helps anyone.

RaiMan (raimund-hocke) wrote :

ok, thanks for finding this.

The only workaround now (and I guess in the future too, until Ivy understands Maven profiles/properties), is to manually download the artifacts from Maven central or from the OSSRH using the links on the nightly build page and place them in a folder, that is suitable for use with SBT/Ivy.
Of course it might be necessary to revise the sikulixapi pom: replace the ${} placeholders with the respective values.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers