Search code examples
scalamavensorm

Error building maven project with sorm dependency


While trying SORM I kept getting this error

ERROR] missing or invalid dependency detected while loading class file 'Logging.class'. Could not access type ScalaObject in package scala, because it (or its dependencies) are missing. Check your build definition for missing or conflicting dependencies. A full rebuild may help if 'Logging.class' was compiled against an incompatible version of scala.

This is my pom file ( derived by the one used by sorm itself)

<?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>sorm-test</groupId>
<artifactId>sorm</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
    <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-reflect</artifactId>
        <version>[2.10,2.12)</version>
    </dependency>
    <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>[2.10,2.12)</version>
    </dependency>

    <dependency>
        <groupId>org.sorm-framework</groupId>
        <artifactId>sorm</artifactId>
        <version>0.3.8</version>
    </dependency>
    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>1.3.168</version>
    </dependency>

</dependencies>

<build>
    <sourceDirectory>src/main/scala</sourceDirectory>
<plugins>
<plugin>
    <groupId>net.alchim31.maven</groupId>
    <artifactId>scala-maven-plugin</artifactId>
    <version>3.2.0</version>
    <configuration>
        <recompileMode>incremental</recompileMode>
        <useZincServer>true</useZincServer>
    </configuration>
    <executions>
        <execution>
            <id>compile</id>
            <goals>
                <goal>compile</goal>
                <goal>testCompile</goal>
            </goals>
        </execution>
    </executions>
</plugin>
</plugins>
</build>

I tried multiple scala library version ( instead of the interval [2.10,2.12) ) but with the same result.

Thanks


Solution

  • I tried your very same pom.xml (and also a version using sbt) and it just works.

    Plus sorm 0.3.8 is a very old version.

    Do you really need that?