Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mvn package -DskipTests can't find jpl, org.slf4j, com.google.commmon.collect, etc #19

Open
gherson opened this issue Mar 27, 2016 · 3 comments
Assignees

Comments

@gherson
Copy link

gherson commented Mar 27, 2016

No errors until mvn package -DskipTests, which can't find packages jpl, org.slf4j, com.google.commmon.collect, etc:

C:\Users\George\Downloads\APE-master\APE-master\java>mvn install:install-file -D
file="C:/Program Files (x86)/pl/lib/jpl.jar" -DgroupId=jpl -DartifactId=jpl -Dve
rsion=7.2.3 -Dpackaging=jar -DgeneratePom=true
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Java Interface for APE 1.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ attempto-ape --
-
[INFO] Installing C:\Program Files (x86)\pl\lib\jpl.jar to C:\Users\George\.m2\r
epository\jpl\jpl\7.2.3\jpl-7.2.3.jar
[INFO] Installing C:\Users\George\AppData\Local\Temp\mvninstall93428386020597161
6.pom to C:\Users\George\.m2\repository\jpl\jpl\7.2.3\jpl-7.2.3.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.761 s
[INFO] Finished at: 2016-03-26T20:44:57-04:00
[INFO] Final Memory: 8M/155M
[INFO] ------------------------------------------------------------------------

C:\Users\George\Downloads\APE-master\APE-master\java>mvn package -DskipTests|mor
e
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Java Interface for APE 1.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ attempto-a
pe ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\George\Downloads\APE-master\
APE-master\java\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ attempto-ape --
-
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 33 source files to C:\Users\George\Downloads\APE-master\APE-mas
ter\java\target\classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] /C:/Users/George/Downloads/APE-master/APE-master/java/src/main/java/ch
/uzh/ifi/attempto/ape/APEWebservice.java: C:\Users\George\Downloads\APE-master\A
PE-master\java\src\main\java\ch\uzh\ifi\attempto\ape\APEWebservice.java uses or
overrides a deprecated API.
[WARNING] /C:/Users/George/Downloads/APE-master/APE-master/java/src/main/java/ch
/uzh/ifi/attempto/ape/APEWebservice.java: Recompile with -Xlint:deprecation for
details.
[INFO] 2 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/George/Downloads/APE-master/APE-master/java/src/main/java/ch/u
zh/ifi/attempto/ape/APELocal.java:[17,1] package jpl does not exist
[ERROR] /C:/Users/George/Downloads/APE-master/APE-master/java/src/main/java/ch/u
zh/ifi/attempto/base/MultiTextContainer.java:[21,33] package com.google.common.c
ollect does not exist
[ERROR] /C:/Users/George/Downloads/APE-master/APE-master/java/src/main/java/ch/u
zh/ifi/attempto/base/LoggerContext.java:[54,26] package org.slf4j does not exist
[ERROR] /C:/Users/George/Downloads/APE-master/APE-master/java/src/main/java/ch/u
zh/ifi/attempto/base/LoggerContext.java:[55,26] package org.slf4j does not exist
[ERROR] /C:/Users/George/Downloads/APE-master/APE-master/java/src/main/java/ch/u
zh/ifi/attempto/base/LoggerContext.java:[56,26] package org.slf4j does not exist
[ERROR] /C:/Users/George/Downloads/APE-master/APE-master/java/src/main/java/ch/u
zh/ifi/attempto/ape/APELocal.java:[69,25] cannot find symbol
  symbol:   variable JPL
  location: class ch.uzh.ifi.attempto.ape.APELocal
[ERROR] /C:/Users/George/Downloads/APE-master/APE-master/java/src/main/java/ch/u
. . .

why?

thanks,
George
(on Windows 7)

p.s. I also had to edit Downloads\APE-master\APE-master\java\pom.xml's
org.apache.maven.plugins
maven-compiler-plugin
2.0.2

1.5
1.5
Advice from http://stackoverflow.com/questions/25912398/maven-project-error-diamond-multicatch-operator-not-supported-in-source-1-5 to make it the following seems to work.
org.apache.maven.plugins
maven-compiler-plugin
3.1

1.8
1.8

@gherson
Copy link
Author

gherson commented Mar 27, 2016

Below pom.xml seems to solve - attempto-ape-1.0.1.jar was created.

<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>ch.uzh.ifi.attempto.ape</groupId>
  <artifactId>attempto-ape</artifactId>
  <packaging>jar</packaging>
  <version>1.0.1</version>
  <name>Java Interface for APE</name>
  <description>Java Interface for APE</description>
  <url>http://attempto.ifi.uzh.ch/</url>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/Attempto/APE/issues?labels=java</url>
  </issueManagement>
  <licenses>
    <license>
      <name>LGPL 3.0 license</name>
      <url>http://www.opensource.org/licenses/lgpl-3.0.html</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Kaarel Kaljurand</name>
      <email>[email protected]</email>
      <timezone>+1</timezone>
    </developer>
    <developer>
      <name>Tobias Kuhn</name>
      <email>[email protected]</email>
      <timezone>+1</timezone>
    </developer>
  </developers>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
    <dependency>
      <groupId>jpl</groupId>
      <artifactId>jpl</artifactId>
      <version>6.0.0</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.5</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.3.1</version>
    </dependency>
    <dependency>
      <groupId>com.sun.phobos</groupId>
      <artifactId>jdom</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.19</version>
    </dependency>
    <dependency>
      <groupId>org.apache.avro</groupId>
      <artifactId>avro-guava-dependencies</artifactId>
      <version>1.8.0</version>
    </dependency>
  </dependencies>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9</version>
      </plugin>
    </plugins>
  </reporting>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

@Kaljurand Kaljurand self-assigned this Apr 2, 2016
@gherson
Copy link
Author

gherson commented Apr 3, 2016

I should also note that I had to try different versions of jpl.jar (which when multiplied by other unknowns became very time consuming). For my Windows 7 laptop, I downloaded them to C:/Program Files (x86)/pl/lib/ and installed them via mvn install:install-file. The winning one was the one from http://www.java2s.com/Code/Jar/j/Downloadjpljar.htm. It was installed via

C:Downloads\APE-master\APE-master\java>mvn install:install-file -Dfile="C:/Program Files (x86)/pl/lib/jpl-6.0.0.jar" -DgroupId=jpl -DartifactId=jpl -Dversion=6.0.0 -Dpackaging=jar -DgeneratePom=true

@Kaljurand
Copy link
Member

Thanks! I'm looking into ways to improve the JPL installation. The thing is that one should use the jar that is included in the SWI-Prolog installation, so that it would match the version of SWI-Prolog that is used by APE. Maybe an installation script like below would be suitable. I don't know though how it would work on Windows.

eval `swipl -dump-runtime-variables`

mvn install:install-file \
-Dfile=$PLBASE/lib/jpl.jar \
-DgroupId=jpl \
-DartifactId=jpl \
-Dversion=$PLVERSION \
-Dpackaging=jar \
-DgeneratePom=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants