Skip to content

Commit

Permalink
Merge pull request #1 from eBay/dev
Browse files Browse the repository at this point in the history
Adding Maven deployment config for helper, ebaycalls, and sdkcore jars
  • Loading branch information
LokeshRishi authored Apr 3, 2024
2 parents 6a015d2 + 3310902 commit 4e7da86
Show file tree
Hide file tree
Showing 16 changed files with 509 additions and 18 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
.project
.classpath
log4j.properties
*.log
*.log
**/javadocs/**
*.asc
60 changes: 46 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
Trading API Java SDK
=============================
# Trading API Java SDK

## Installation Instructions

Please note that upgrades to an SDK should always be done in a test environment and fully tested before used in production.

1. Download the zip file for the version of the eBay SDK for Java that you are using.
1. Download the zip file for the version of the eBay SDK for Java that you are using.

2. Note the location of the zip file you downloaded, but before extracting the file, create the following folder: C:\\eBayJavaSDK.
2. Note the location of the zip file you downloaded, but before extracting the file, create the following folder: C:\\eBayJavaSDK.

3. Within C:\\eBayJavaSDK, create an "SDKInstallDir" folder to contain the SDK files. You could name that folder according to the Trading API version of the SDK you are installing. For example, for the SDK for Trading API version 1331, you could name the folder _eBayJavaSDK1331_.
3. Within C:\\eBayJavaSDK, create an "SDKInstallDir" folder to contain the SDK files. You could name that folder according to the Trading API version of the SDK you are installing. For example, for the SDK for Trading API version 1331, you could name the folder _eBayJavaSDK1331_.

4. Go the location of the zip file you downloaded (noted in step 3), and extract the zip file into the SDKInstallDir folder you created in step 4.
4. Go the location of the zip file you downloaded (noted in step 3), and extract the zip file into the SDKInstallDir folder you created in step 4.

5. To build the SDK, see [Building the SDK](#building-the-sdk).(If you're using an Integrated Development Environment (IDE), you do not need to build the SDK, you just need to set the paths to point to the correct libraries and files. See [DevEnvReadme](DevEnvReadme.md) for more information for configuring an IDE)
5. To build the SDK, see [Building the SDK](#building-the-sdk).(If you're using an Integrated Development Environment (IDE), you do not need to build the SDK, you just need to set the paths to point to the correct libraries and files. See [DevEnvReadme](DevEnvReadme.md) for more information for configuring an IDE)

---

Expand All @@ -24,19 +23,19 @@ Please note that upgrades to an SDK should always be done in a test environment
* [Post-Installation Configuration](#post-installation-configuration)

* [SDK-Related Links](#sdk-related-links)

* [Building the SDK](#building-the-sdk)

* [Documentation](#documentation)

* [Known Issues](#known-issues)

* [Included in the eBay SDK for Java](#included-in-the-ebay-sdk-for-java)

* [WSDL Locations](#wsdl-locations)

* [WSDL Updates](#wsdl-updates)

* [Supported Client Environments](#supported-client-environments)

* [Notes About Logging](#notes-about-logging)
Expand Down Expand Up @@ -78,6 +77,39 @@ Modify and run the [setenv.bat](./build/setenv.bat) file as follows:

[Back to top](#top)

## Usage

### Prerequisites

``` text
Maven: version 3.5.0
Java: 8 or higher
```

### Install

Adding dependency:

```xml
<dependency>
<groupId>com.ebay.developer</groupId>
<artifactId>trading-api-sdkcore</artifactId>
<version>1.0.0-RELEASE</version>
</dependency>

<dependency>
<groupId>com.ebay.developer</groupId>
<artifactId>trading-api-ebaycalls</artifactId>
<version>1.0.0-RELEASE</version>
</dependency>

<dependency>
<groupId>com.ebay.developer</groupId>
<artifactId>trading-api-helper</artifactId>
<version>1.0.0-RELEASE</version>
</dependency>
```

### Building the SDK

In this section, you will use an ANT project file, build.xml, to do the following:
Expand Down
151 changes: 148 additions & 3 deletions build/build.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?xml version="1.0"?>

<project default="help" basedir="." name="eBayService">
<project default="help" basedir="." name="eBayService"
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<property environment="env"/>
<property name="eBaySDK.home" value="${basedir}/.."/>
<property name="source.home" value="${eBaySDK.home}/source"/>
<property name="jdk.home" value="${env.JAVA_HOME}"/>

<property name="dependency.lib.home" value="${eBaySDK.home}/lib/externalLib/"/>
<property name="ossrh-server-id" value="ossrh" />
<property name="ossrh.deploy.url" value="https://oss.sonatype.org/service/local/staging/deploy/maven2/"/>

<!-- change the version number for a new release- -->
<property name="new.version" value="1331"/>
Expand Down Expand Up @@ -77,6 +79,10 @@
</fileset>
</path>

<!-- Maven Ant Tasks -->
<path id="maven-ant-tasks.classpath" path="${eBaySDK.home}/lib/externalLib/maven-ant-tasks-2.1.3.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />

<target name="checkJavaHome" unless="env.JAVA_HOME">
<fail>
"JAVA_HOME" environment variable is not set. You may set "JAVA_HOME" in
Expand All @@ -87,6 +93,102 @@
<target name="checkEnvironment">
<antcall target="checkJavaHome"/>
</target>

<!-- Deploy the generated JARs to Maven Central -->
<target name="deploy">
<!-- Deploy the main JARs -->
<exec executable="mvn">
<arg value="gpg:sign-and-deploy-file"/>
<arg value="-Dgpg.keyname=${gpg.keyname}"/>
<arg value="-Dgpg.passphrase=${gpg.passphrase}"/>
<arg value="-Durl=${ossrh.deploy.url}"/>
<arg value="-DrepositoryId=ossrh"/>
<arg value="-Dfile=${eBaySDK.home}/lib/ebaycalls/ebaycalls.jar"/>
<arg value="-DpomFile=${eBaySDK.home}/lib/ebaycalls/pom.xml"/>
</exec>
<exec executable="mvn">
<arg value="gpg:sign-and-deploy-file"/>
<arg value="-Dgpg.keyname=${gpg.keyname}"/>
<arg value="-Dgpg.passphrase=${gpg.passphrase}"/>
<arg value="-Durl=${ossrh.deploy.url}"/>
<arg value="-DrepositoryId=ossrh"/>
<arg value="-Dfile=${eBaySDK.home}/lib/sdkcore/ebaysdkcore.jar"/>
<arg value="-DpomFile=${eBaySDK.home}/lib/sdkcore/pom.xml"/>
</exec>
<exec executable="mvn">
<arg value="gpg:sign-and-deploy-file"/>
<arg value="-Dgpg.keyname=${gpg.keyname}"/>
<arg value="-Dgpg.passphrase=${gpg.passphrase}"/>
<arg value="-Durl=${ossrh.deploy.url}"/>
<arg value="-DrepositoryId=ossrh"/>
<arg value="-Dfile=${eBaySDK.home}/lib/helper/helper.jar"/>
<arg value="-DpomFile=${eBaySDK.home}/lib/helper/pom.xml"/>
</exec>

<!-- Deploy the -sources JARs -->
<exec executable="mvn">
<arg value="gpg:sign-and-deploy-file"/>
<arg value="-Dgpg.keyname=${gpg.keyname}"/>
<arg value="-Dgpg.passphrase=${gpg.passphrase}"/>
<arg value="-Durl=${ossrh.deploy.url}"/>
<arg value="-DrepositoryId=ossrh"/>
<arg value="-Dfile=${eBaySDK.home}/lib/ebaycalls/ebaycalls-sources.jar"/>
<arg value="-DpomFile=${eBaySDK.home}/lib/ebaycalls/pom.xml"/>
<arg value="-Dclassifier=sources"/>
</exec>
<exec executable="mvn">
<arg value="gpg:sign-and-deploy-file"/>
<arg value="-Dgpg.keyname=${gpg.keyname}"/>
<arg value="-Dgpg.passphrase=${gpg.passphrase}"/>
<arg value="-Durl=${ossrh.deploy.url}"/>
<arg value="-DrepositoryId=ossrh"/>
<arg value="-Dfile=${eBaySDK.home}/lib/sdkcore/ebaysdkcore-sources.jar"/>
<arg value="-DpomFile=${eBaySDK.home}/lib/sdkcore/pom.xml"/>
<arg value="-Dclassifier=sources"/>
</exec>
<exec executable="mvn">
<arg value="gpg:sign-and-deploy-file"/>
<arg value="-Dgpg.keyname=${gpg.keyname}"/>
<arg value="-Dgpg.passphrase=${gpg.passphrase}"/>
<arg value="-Durl=${ossrh.deploy.url}"/>
<arg value="-DrepositoryId=ossrh"/>
<arg value="-Dfile=${eBaySDK.home}/lib/helper/helper-sources.jar"/>
<arg value="-DpomFile=${eBaySDK.home}/lib/helper/pom.xml"/>
<arg value="-Dclassifier=sources"/>
</exec>

<!-- Deploy the -javadocs JARs -->
<exec executable="mvn">
<arg value="gpg:sign-and-deploy-file"/>
<arg value="-Dgpg.keyname=${gpg.keyname}"/>
<arg value="-Dgpg.passphrase=${gpg.passphrase}"/>
<arg value="-Durl=${ossrh.deploy.url}"/>
<arg value="-DrepositoryId=ossrh"/>
<arg value="-Dfile=${eBaySDK.home}/lib/ebaycalls/ebaycalls-javadoc.jar"/>
<arg value="-DpomFile=${eBaySDK.home}/lib/ebaycalls/pom.xml"/>
<arg value="-Dclassifier=javadoc"/>
</exec>
<exec executable="mvn">
<arg value="gpg:sign-and-deploy-file"/>
<arg value="-Dgpg.keyname=${gpg.keyname}"/>
<arg value="-Dgpg.passphrase=${gpg.passphrase}"/>
<arg value="-Durl=${ossrh.deploy.url}"/>
<arg value="-DrepositoryId=ossrh"/>
<arg value="-Dfile=${eBaySDK.home}/lib/sdkcore/ebaysdkcore-javadoc.jar"/>
<arg value="-DpomFile=${eBaySDK.home}/lib/sdkcore/pom.xml"/>
<arg value="-Dclassifier=javadoc"/>
</exec>
<exec executable="mvn">
<arg value="gpg:sign-and-deploy-file"/>
<arg value="-Dgpg.keyname=${gpg.keyname}"/>
<arg value="-Dgpg.passphrase=${gpg.passphrase}"/>
<arg value="-Durl=${ossrh.deploy.url}"/>
<arg value="-DrepositoryId=ossrh"/>
<arg value="-Dfile=${eBaySDK.home}/lib/helper/helper-javadoc.jar"/>
<arg value="-DpomFile=${eBaySDK.home}/lib/helper/pom.xml"/>
<arg value="-Dclassifier=javadoc"/>
</exec>
</target>

<!--It should point to siteURL for the final build ##REVERT##-->
<target name="getWsdl">
Expand Down Expand Up @@ -252,6 +354,50 @@
</delete>
</target>

<target name="generate-all-javadocs">
<antcall target="generate-javadoc-jar">
<param name="srcjar.dir" value="../lib/ebaycalls/ebaycalls-sources.jar"/>
<param name="javadoc.dir" value="../lib/ebaycalls/javadocs"/>
<param name="javadoc.jar" value="../lib/ebaycalls/ebaycalls-javadoc.jar"/>
</antcall>
<antcall target="generate-javadoc-jar">
<param name="srcjar.dir" value="../lib/helper/helper-sources.jar"/>
<param name="javadoc.dir" value="../lib/helper/javadocs"/>
<param name="javadoc.jar" value="../lib/helper/helper-javadoc.jar"/>
</antcall>
<antcall target="generate-javadoc-jar">
<param name="srcjar.dir" value="../lib/sdkcore/ebaysdkcore-sources.jar"/>
<param name="javadoc.dir" value="../lib/sdkcore/javadocs"/>
<param name="javadoc.jar" value="../lib/sdkcore/ebaysdkcore-javadoc.jar"/>
</antcall>
</target>

<target name="generate-javadoc-jar">
<!-- Create a temporary directory to extract the source JAR -->
<tempfile property="temp.dir" destdir="${java.io.tmpdir}" prefix="javadoc" deleteonexit="true"/>
<mkdir dir="${temp.dir}"/>

<!-- Check if the source JAR file exists -->
<available file="${srcjar.dir}" property="srcjar.exists"/>
<fail unless="srcjar.exists" message="Source JAR file ${srcjar.dir} does not exist"/>

<!-- Extract the source JAR to the temporary directory -->
<unjar src="${srcjar.dir}" dest="${temp.dir}"/>

<!-- Generate the Javadocs from the extracted source files -->
<javadoc sourcepath="${temp.dir}" destdir="${javadoc.dir}" packagenames="com.ebay.*">
<classpath>
<pathelement location="lib/some-library.jar"/>
</classpath>
</javadoc>

<!-- Package the Javadocs into a JAR -->
<jar basedir="${javadoc.dir}" destfile="${javadoc.jar}"/>

<!-- Delete the temporary directory -->
<delete dir="${temp.dir}"/>
</target>

<!-- for internal use -->
<!-- <target name="docGen" depends="cleanDoc, javaDocGen, jDiffGen"/>-->
<target name="docGen" depends="cleanDoc, javaDocGen"/>
Expand Down Expand Up @@ -351,5 +497,4 @@
<echo message="build ==> compiles and builds all jars"/>
<echo message="fastbuild ==> compiles and builds all jars without re-generating proxy/wrappers from wsdl"/>
</target>

</project>
Binary file added lib/ebaycalls/ebaycalls-javadoc.jar
Binary file not shown.
Binary file added lib/ebaycalls/ebaycalls-sources.jar
Binary file not shown.
Binary file added lib/ebaycalls/ebaycalls.jar
Binary file not shown.
104 changes: 104 additions & 0 deletions lib/ebaycalls/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<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.ebay.developer</groupId>
<artifactId>trading-api-ebaycalls</artifactId>
<version>1.0.0-RELEASE</version>

<name>trading-api-ebaycalls</name>
<description>eBay Trading API Java SDK eBay Calls</description>
<url>https://github.com/eBay/trading-api-java-sdk</url>

<licenses>
<license>
<name>Eclipse Public License - v 2.0</name>
<url>https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<name>Lokesh Rishi</name>
<organization>eBay</organization>
<organizationUrl>https://developer.ebay.com</organizationUrl>
</developer>
<developer>
<name>Zhuowei Yang</name>
<organization>eBay</organization>
<organizationUrl>https://developer.ebay.com</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:[email protected]:eBay/trading-api-java-sdk.git</connection>
<url>https://github.com/eBay/trading-api-java-sdk</url>
</scm>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.4.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<tokenAuth>true</tokenAuth>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<keyname>${gpg.keyname}</keyname>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Binary file added lib/externalLib/maven-ant-tasks-2.1.3.jar
Binary file not shown.
Binary file added lib/helper/helper-javadoc.jar
Binary file not shown.
Binary file added lib/helper/helper-sources.jar
Binary file not shown.
Binary file added lib/helper/helper.jar
Binary file not shown.
Loading

0 comments on commit 4e7da86

Please sign in to comment.