Skip to content
Merged

2.8.0 #194

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .utility/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
echo '$TRAVIS_PULL_REQUEST is false, running all tests'
mvn clean cobertura:cobertura-integration-test coveralls:report
mvn clean cobertura:cobertura-integration-test
else
echo '$TRAVIS_PULL_REQUEST is not false ($TRAVIS_PULL_REQUEST), running unit tests'
mvn clean test
fi
fi
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Watson Developer Cloud Java SDK
[![Build Status](https://travis-ci.org/watson-developer-cloud/java-sdk.svg?branch=master)](https://travis-ci.org/watson-developer-cloud/java-sdk)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.ibm.watson.developer_cloud/java-sdk/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.ibm.watson.developer_cloud/java-sdk)
[![Coverage Status](https://coveralls.io/repos/watson-developer-cloud/java-sdk/badge.svg)](https://coveralls.io/github/watson-developer-cloud/java-sdk)
[![codecov.io](https://codecov.io/github/watson-developer-cloud/java-sdk/coverage.svg?branch=master)](https://codecov.io/github/watson-developer-cloud/java-sdk?branch=master)

Java client library to use the [Watson Developer Cloud][wdc] services, a collection of REST
APIs and SDKs that use cognitive computing to solve complex problems.
Expand All @@ -14,7 +14,6 @@ APIs and SDKs that use cognitive computing to solve complex problems.
* [Usage](#usage)
* [Getting the Service Credentials](#getting-the-service-credentials)
* [Questions](#questions)
* [Examples](#examples)
* [IBM Watson Services](#ibm-watson-services)
* [Alchemy Language](#alchemy-language)
* [Alchemy Vision](#alchemy-vision)
Expand All @@ -23,9 +22,7 @@ APIs and SDKs that use cognitive computing to solve complex problems.
* [Concept Insights](#concept-insights)
* [Dialog](#dialog)
* [Document Conversion](#document-conversion)
* [Language Identification](#language-identification)
* [Language Translation](#language-translation)
* [Machine Translation](#machine-translation)
* [Natural Language Classifier](#natural-language-classifier)
* [Personality Insights](#personality-insights)
* [Relationship Extraction](#relationship-extraction)
Expand All @@ -38,9 +35,7 @@ APIs and SDKs that use cognitive computing to solve complex problems.
* [Visual Recognition](#visual-recognition)
* [Android](#android)
* [Running in Bluemix](#running-in-bluemix)
* [Build + Test](#build--test)
* [Eclipse and Intellij](#working-with-eclipse-and-intellij-idea)
* [Open Source @ IBM](#open-source--ibm)
* [License](#license)
* [Contributing](#contributing)

Expand All @@ -53,13 +48,13 @@ APIs and SDKs that use cognitive computing to solve complex problems.
<dependency>
<groupId>com.ibm.watson.developer_cloud</groupId>
<artifactId>java-sdk</artifactId>
<version>2.7.1</version>
<version>2.8.0</version>
</dependency>
```
##### Gradle

```gradle
'com.ibm.watson.developer_cloud:java-sdk:2.7.1'
'com.ibm.watson.developer_cloud:java-sdk:2.8.0'
```

Now, you are ready to see some [examples](https://github.com/watson-developer-cloud/java-sdk/tree/master/examples/java/com/ibm/watson/developer_cloud).
Expand Down Expand Up @@ -129,7 +124,7 @@ service.setApiKey("<api_key>");
File image = new File("src/test/resources/alchemy/obama.jpg");
Boolean forceShowAll = false;
Boolean knowledgeGraph = false;
ImageKeywords keywords = service.getImageKeywords(, forceShowAll, knowledgeGraph);
ImageKeywords keywords = service.getImageKeywords(image, forceShowAll, knowledgeGraph);

System.out.println(keywords);
```
Expand Down Expand Up @@ -365,9 +360,10 @@ System.out.println(voices);
Use the [Tone Analyzer][tone_analyzer] service to get the tone of your email.

```java
ToneAnalyzer service = new ToneAnalyzer();
ToneAnalyzer service = new ToneAnalyzer(ToneAnalyzer.VERSION_DATE_2016_02_11);
service.setUsernameAndPassword("<username>", "<password>");


String text = "I know the times are difficult! Our sales have been "
+ "disappointing for the past three quarters for our data analytics "
+ "product suite. We have a competitive data analytics product "
Expand All @@ -377,6 +373,10 @@ String text = "I know the times are difficult! Our sales have been "
// Call the service and get the tone
Tone tone = service.getTone(text, Scorecard.EMAIL);
System.out.println(tone);


ToneAnalysis tone = service.getTone(text);
System.out.println(tone);
```


Expand Down Expand Up @@ -481,7 +481,7 @@ Gradle:

```sh
$ cd java-sdk
$ gradle jar # build jar file (build/libs/watson-developer-cloud-2.7.1.jar)
$ gradle jar # build jar file (build/libs/watson-developer-cloud-2.8.0.jar)
$ gradle test # run tests
```

Expand Down Expand Up @@ -551,4 +551,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
[apache_maven]: http://maven.apache.org/
[releases]: https://github.com/watson-developer-cloud/java-sdk/releases

[jar]: https://github.com/watson-developer-cloud/java-sdk/releases/download/java-sdk-2.7.1/java-sdk-2.7.1-jar-with-dependencies.jar
[jar]: https://github.com/watson-developer-cloud/java-sdk/releases/download/java-sdk-2.8.0/java-sdk-2.8.0-jar-with-dependencies.jar
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* Copyright 2015 IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.ibm.watson.developer_cloud.tone_analyzer.v3;

import com.ibm.watson.developer_cloud.tone_analyzer.v3.model.ToneAnalysis;

public class ToneAnalyzerExample {


public static void main(String[] args) {
ToneAnalyzer service = new ToneAnalyzer(ToneAnalyzer.VERSION_DATE_2016_02_11);
service.setUsernameAndPassword("<username>", "<password>");

String text =
"I know the times are difficult! Our sales have been "
+ "disappointing for the past three quarters for our data analytics "
+ "product suite. We have a competitive data analytics product "
+ "suite in the industry. But we need to do our job selling it! "
+ "We need to acknowledge and fix our sales challenges. "
+ "We can’t blame the economy for our lack of execution! "
+ "We are missing critical sales opportunities. "
+ "Our product is in no way inferior to the competitor products. "
+ "Our clients are hungry for analytical tools to improve their "
+ "business outcomes. Economy has nothing to do with it.";

// Call the service and get the tone
ToneAnalysis tone = service.getTone(text);
System.out.println(tone);

}
}
2 changes: 1 addition & 1 deletion examples/retrieve-and-rank-solrj/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<dependency>
<groupId>com.ibm.watson.developer_cloud</groupId>
<artifactId>java-sdk</artifactId>
<version>2.7.1</version>
<version>2.8.0</version>
</dependency>
</dependencies>
</project>
75 changes: 15 additions & 60 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<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.ibm.watson.developer_cloud</groupId>
<version>2.7.2-SNAPSHOT</version>
<version>2.8.1-SNAPSHOT</version>
<packaging>jar</packaging>
<artifactId>java-sdk</artifactId>
<name>Watson Developer Cloud Java SDK</name>
Expand Down Expand Up @@ -128,23 +128,6 @@
<goals>deploy</goals>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
<format>xml</format>
<instrumentation>
<excludes>
<exclude>com/ibm/watson/developer_cloud/*/v*/model/**/*.class</exclude>
</excludes>
<excludes>
<exclude>com/ibm/watson/developer_cloud/*/**/*Example.class</exclude>
</excludes>
</instrumentation>
</configuration>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
Expand Down Expand Up @@ -174,51 +157,23 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<configuration>
<excludes>
<exclude>com/ibm/watson/developer_cloud/*/v*/model/**/*.class</exclude>
<exclude>com/ibm/watson/developer_cloud/**/*Example.*</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- <plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.11</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java16</artifactId>
<version>1.1</version>
</signature>
<format>xml</format>
<aggregate>true</aggregate>
<instrumentation>
<ignores>
<ignore>*.model*</ignore>
</ignores>
<excludes>
<exclude>**/*/model/*</exclude>
</excludes>
</instrumentation>
</configuration>
</plugin> -->
</plugin>
</plugins>
<resources>
<resource>
Expand Down
Loading