owlcollab / owltools

OWLTools
BSD 3-Clause "New" or "Revised" License
108 stars 33 forks source link

OWL Tools Jar - Unable to integrate into Maven based Application - Windows 8 #202

Open karanthpallavi opened 7 years ago

karanthpallavi commented 7 years ago

Hello,

Have downloaded jar of OWLTools from https://github.com/owlcollab/owltools/releases/tag/v0.3.0,

My pom.xml looks like this:

<?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.mycompany</groupId>
    <artifactId>SemanticDistance</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <build>
        <plugins>
            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-install-plugin</artifactId>
            <version>2.5.2</version>
            <executions>
                <execution>
                    <phase>initialize</phase>
                    <goals>
                        <goal>install-file</goal>
                    </goals>
                    <configuration>
                        <file>${basedir}/owltools.jar</file>
                        <groupId>com.mycompany</groupId>
                        <artifactId>SemanticDistance</artifactId>
                        <version>1.0</version>
                        <packaging>jar</packaging>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        </plugins>
</build>
    <dependencies>
        <dependency>
            <groupId>com.mycompany</groupId>
    <artifactId>SemanticDistance</artifactId>
    <version>1.0-SNAPSHOT</version>
            <exclusions>
        <exclusion>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
        </exclusion>
        <exclusion>
            <groupId>com.google.inject.extensions</groupId>
            <artifactId>guice-multibindings</artifactId>
        </exclusion>
        <exclusion>
            <groupId>com.google.inject.extensions</groupId>
            <artifactId>guice-assistedinject</artifactId>
        </exclusion>
    </exclusions>
</dependency>
  <dependency>
    <groupId>com.google.inject</groupId>
    <artifactId>guice</artifactId>
    <version>4.1.0</version>
</dependency>
        <dependency>
    <groupId>com.google.inject.extensions</groupId>
    <artifactId>guice-multibindings</artifactId>
    <version>4.0</version>
</dependency>
<dependency>
    <groupId>net.sourceforge.owlapi</groupId>
    <artifactId>owlapi-fixers</artifactId>
    <version>5.0.1</version>
</dependency>
        <dependency>
            <groupId>net.sourceforge.owlapi</groupId>
            <artifactId>owlapi-api</artifactId>
            <version>5.0.5</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.24</version>
        </dependency>  
        <dependency>
            <groupId>net.sourceforge.owlapi</groupId>
            <artifactId>owlapi-osgidistribution</artifactId>
            <version>5.0.5</version>
            <type>jar</type>
        </dependency>
    </dependencies>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
</project>

Application uses import owltools.graph - This throws up error owltools - package does not exist. Is this the correct way to include jar into maven based app? How do we confirm that maven has installed this jar? Am i doing something wrong? Kindly help..

karanthpallavi commented 7 years ago

Is it something to do with Windows? Is the package stable on Linux? Or are there any issues on Linux? Stuck in my development work, Kindly help me solve this.

dougli1sqrd commented 7 years ago

At what stage does the error occur? During your maven build? Or when you're trying to run it?

karanthpallavi commented 7 years ago

Have directly used maven install plugin to install owltools jar file in my application.. not sure if it's installed.. when I put "import owltools.graph" I get compilation error that the package doesn't exist

balhoff commented 7 years ago

It doesn't look like you have owltools in your dependencies. You need to add it there in your POM.

karanthpallavi commented 7 years ago

Have added path to owltools.jar in pom.xml to be installed by maven install plugin. Please see pom.xml..

As I could not build owltools on Windows, have directly downloaded owltools.jar to be used in my application..

On Tue, Jun 13, 2017, 6:05 PM Jim Balhoff notifications@github.com wrote:

It doesn't look like you have owltools in your dependencies. You need to add it there in your POM.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/owlcollab/owltools/issues/202#issuecomment-308101517, or mute the thread https://github.com/notifications/unsubscribe-auth/AYvmOg2L1DAVYVQkjIRpKALt4fmWvDKfks5sDoH-gaJpZM4N2riK .

balhoff commented 7 years ago

As far as I know this won't add it to your classpath. It needs to be listed in the dependencies section.

karanthpallavi commented 7 years ago

Will try it...

On Tue, Jun 13, 2017, 6:09 PM Jim Balhoff notifications@github.com wrote:

As far as I know this won't add it to your classpath. It needs to be listed in the dependencies section.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/owlcollab/owltools/issues/202#issuecomment-308102467, or mute the thread https://github.com/notifications/unsubscribe-auth/AYvmOjb5t4Sanqnxn1sJmplB0XSsQt7Vks5sDoLkgaJpZM4N2riK .

karanthpallavi commented 7 years ago

May i know the group id to be specified in the dependency section for owl tools?

My pom.xml is like this:

<?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.mycompany</groupId>
    <artifactId>SemanticDistance</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <build>
        <plugins>
            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-install-plugin</artifactId>
            <version>2.5.2</version>
            <executions>
                <execution>
                    <phase>initialize</phase>
                    <goals>
                        <goal>install-file</goal>
                    </goals>
                    <configuration>
                        <file>${basedir}/owltools.jar</file>
                        <groupId>com.mycompany</groupId>
                        <artifactId>SemanticDistance</artifactId>
                        <version>0.3.0</version>
                        <packaging>jar</packaging>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        </plugins>
</build>
    <dependencies>
        <dependency>
            <groupId>com.mycompany</groupId>
    <artifactId>SemanticDistance</artifactId>
    <version>1.0-SNAPSHOT</version>
            <exclusions>
        <exclusion>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
        </exclusion>
        <exclusion>
            <groupId>com.google.inject.extensions</groupId>
            <artifactId>guice-multibindings</artifactId>
        </exclusion>
        <exclusion>
            <groupId>com.google.inject.extensions</groupId>
            <artifactId>guice-assistedinject</artifactId>
        </exclusion>
    </exclusions>
</dependency>
  <dependency>
    <groupId>com.google.inject</groupId>
    <artifactId>guice</artifactId>
    <version>4.1.0</version>
</dependency>
        <dependency>
    <groupId>com.google.inject.extensions</groupId>
    <artifactId>guice-multibindings</artifactId>
    <version>4.0</version>
</dependency>
<dependency>
    <groupId>net.sourceforge.owlapi</groupId>
    <artifactId>owlapi-fixers</artifactId>
    <version>5.0.1</version>
</dependency>
        <dependency>
            <groupId>net.sourceforge.owlapi</groupId>
            <artifactId>owlapi-api</artifactId>
            <version>5.0.5</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.24</version>
        </dependency>  
        <dependency>
            <groupId>net.sourceforge.owlapi</groupId>
            <artifactId>owlapi-osgidistribution</artifactId>
            <version>5.0.5</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.bbop</groupId>
            <artifactId>OWLTools-Parent</artifactId>
            <version>0.3.0-SNAPSHOT</version>
            <type>pom</type>
        </dependency>
    </dependencies>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
</project>

Is this correct? Without "import owltools.graph" statement, application compiles... With the import statement, we get compilation error - Package does'nt exist...

Please help

karanthpallavi commented 7 years ago

Hope this pom.xml is fine, Still getting compilation error on using the statement import owltools.graph in my code,

Please see this pom.xml:

<?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.mycompany</groupId>
    <artifactId>SemanticDistance</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <build>
        <plugins>
            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-install-plugin</artifactId>
            <version>2.5.2</version>
            <executions>
                <execution>
                    <phase>initialize</phase>
                    <goals>
                        <goal>install-file</goal>
                    </goals>
                    <configuration>
                        <file>${basedir}/owltools.jar</file>
                        <groupId>com.mycompany</groupId>
                        <artifactId>SemanticDistance</artifactId>
                        <version>0.3.0</version>
                        <packaging>jar</packaging>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        </plugins>
</build>
    <dependencies>
        <dependency>
            <groupId>com.mycompany</groupId>
    <artifactId>SemanticDistance</artifactId>
    <version>1.0-SNAPSHOT</version>
            <exclusions>
        <exclusion>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
        </exclusion>
        <exclusion>
            <groupId>com.google.inject.extensions</groupId>
            <artifactId>guice-multibindings</artifactId>
        </exclusion>
        <exclusion>
            <groupId>com.google.inject.extensions</groupId>
            <artifactId>guice-assistedinject</artifactId>
        </exclusion>
    </exclusions>
</dependency>
  <dependency>
    <groupId>com.google.inject</groupId>
    <artifactId>guice</artifactId>
    <version>4.1.0</version>
</dependency>
        <dependency>
    <groupId>com.google.inject.extensions</groupId>
    <artifactId>guice-multibindings</artifactId>
    <version>4.0</version>
</dependency>
<dependency>
    <groupId>net.sourceforge.owlapi</groupId>
    <artifactId>owlapi-fixers</artifactId>
    <version>5.0.1</version>
</dependency>
        <dependency>
            <groupId>net.sourceforge.owlapi</groupId>
            <artifactId>owlapi-api</artifactId>
            <version>5.0.5</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.24</version>
        </dependency>  
        <dependency>
            <groupId>net.sourceforge.owlapi</groupId>
            <artifactId>owlapi-osgidistribution</artifactId>
            <version>5.0.5</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.bbop</groupId>
            <artifactId>OWLTools-Parent</artifactId>
            <version>0.3.0-SNAPSHOT</version>
            <type>pom</type>
        </dependency>
    </dependencies>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
</project>

kindly help, am stuck

karanthpallavi commented 7 years ago

Kindly help me on this issue... Am stuck in my development..

balhoff commented 7 years ago

What if you try depending on OWLTools-Core instead of OWLTools-Parent, and remove <type>pom</type>? Do you have the owltools jars installed in your local maven repository? If not, you may need to add the BBOP repository to your POM:

<repositories>
        <repository>
            <id>BerkeleyBOP</id>
            <name>Berkeley BOP maven repository</name>
            <url>http://code.berkeleybop.org/maven/repository/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>BerkeleyBOPSnapshot</id>
            <url>http://code.berkeleybop.org/maven/snapshot-repository/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
karanthpallavi commented 7 years ago

Thanks for your quick response, shall try this and get back... Thanks a ton

karanthpallavi commented 6 years ago

Back after quite some time, Have found org/bbop folder in local maven repository, But not sure if its correctly installed, Added BBOP repository to pom.xml as suggested, But am getting the following error while building:

The POM for org.bbop:OWLTools-Core:pom:0 is missing, no dependency information available

Can you kindly help me out?

karanthpallavi commented 6 years ago

Earlier problem is solved, But owltools.graph package does not exist Able to compile successfully, But adding the statement import owltools.graph causes error - Package does not exist, Kindly help... Am stuck