Skip to content
This repository was archived by the owner on Jun 12, 2019. It is now read-only.

Maven project #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 0 additions & 9 deletions .classpath

This file was deleted.

67 changes: 67 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

# Created by https://www.gitignore.io/api/maven,eclipse

### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties


### Eclipse ###

.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders

# Eclipse Core
.project

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# PyDev specific (Python IDE for Eclipse)
*.pydevproject

# CDT-specific (C/C++ Development Tooling)
.cproject

# JDT-specific (Eclipse Java Development Tools)
.classpath

# Java annotation processor (APT)
.factorypath

# PDT-specific (PHP Development Tools)
.buildpath

# sbteclipse plugin
.target

# Tern plugin
.tern-project

# TeXlipse plugin
.texlipse

# STS (Spring Tool Suite)
.springBeans

# Code Recommenders
.recommenders/
17 changes: 0 additions & 17 deletions .project

This file was deleted.

11 changes: 0 additions & 11 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

38 changes: 8 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,11 @@ ApiEndpoint=https://api.cp.microsoft.com

Follow these steps

1. Download the following jars and save them in a local folder
* Apache HttpClient 4.5 is located at https://hc.apache.org/downloads.cgi
* Download and extract the .zip file httpcomponents-client-4.5-bin.zip in to a folder
* Download JSON parser - json_simple-1.1.jar from https://code.google.com/p/json-simple/downloads/detail?name=json_simple-1.1.jar&can=2&q= in to a folder
2. Download and extract the Commerce-API-Java source code zip file from GIT hub
3. Eclipse IDE is required to run the Commerce-API-Java project, please download the same from https://www.eclipse.org/downloads/
4. If JDK is not installed, download & install latest jdk from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
5. Open the eclipse IDE and click on File->Import

![File Import Menu](https://raw.githubusercontent.com/PartnerCenterSamples/Commerce-API-Java/master/ReadmeImages/CREST-Java-Img-1.png "File Import Menu")
6. Select “Existing Projects into Workspace” option and click next

![Existing Projects into Workspace](https://raw.githubusercontent.com/PartnerCenterSamples/Commerce-API-Java/master/ReadmeImages/CREST-Java-Img-2.png "Existing Projects into Workspace")
7. Select the root directory option and browse for the extracted code, an example illustration is shown below. Click Finish

![Import Projects](https://raw.githubusercontent.com/PartnerCenterSamples/Commerce-API-Java/master/ReadmeImages/CREST-Java-Img-3.png "Import Projects")
8. The code along with the project should appear as below in the eclipse IDE

![Code in IDE](https://raw.githubusercontent.com/PartnerCenterSamples/Commerce-API-Java/master/ReadmeImages/CREST-Java-Img-4.png "Code in IDE")
9. Configure the Java Build Path
1. Right click on the project and click on “Properties->Java Build Path”
2. Click “Add External JARs” and choose the following jar files from the local folders where they were downloaded earlier
* httpclient-4.5.jar
* httpcore-4.4.1.jar
* commons-logging-1.2.jar
* json-simple-1.1.1.jar

![Java Build Path](https://raw.githubusercontent.com/PartnerCenterSamples/Commerce-API-Java/master/ReadmeImages/CREST-Java-Img-5.png "Java Build Path")
10. Eclipse should now build the project with no errors.
11. To run the sample right click on the file TestCrestApi.java, select Debug-As, and select Java Application.
1. Eclipse IDE is optional to run the Commerce-API-Java project, please download the same from https://www.eclipse.org/downloads/
2. If JDK is not installed, download & install latest jdk from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
3. Open the eclipse IDE and click on File->Import
4. ![File Import Menu](https://raw.githubusercontent.com/PartnerCenterSamples/Commerce-API-Java/master/ReadmeImages/CREST-Java-Img-1.png "File Import Menu")
6. Select “Maven > Existing Maven Projects” option and click next
7. Select the root directory option and browse for the extracted code. Click Finish
8. Eclipse should now build the project with no errors.
9. To run the sample right click on the file TestCrestApi.java, select Debug-As, and select Java Application.
24 changes: 24 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<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> com.microsoft.partnercenter</groupId>
<artifactId>Commerce-API-Java</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
</project>