This project is read-only.

How to integrate Aspose API for Maven Project

Aspose Maven Dependencies for all Aspose Java APIs Product line have been launched and now supported by Aspose Cloud Maven Repository, therefore the strongly recommended method for the integration of Aspose Java APIs in Maven Project is through defining Aspose Cloud Maven Repository url in your pom.xml and then declaring your Aspose Maven dependencies.

As explained in the following aspose Blog link:

Configuring Aspose Cloud Maven Repository for Maven Projects

But if you still want to stick to old way (strongly discouraged) of creating local aspose maven dependencies and then defining local maven repository location and dependencies in pom.xml then follow as below:

First of All you need to download the latest Aspose APIs by using any of the following methods

 Note: This tutorial assumes that you have basic understanding about Maven and Java Project.

Create Aspose APIs Maven repository

After downloading Aspose APIs, you need to create lib and asposeapis at the root of your java or java web project.

Note: If you have not yet installed Maven 3 in your system please refer to installing and configuring Maven 3.  

Then copy downloaded Aspose Java API jars into the lib folder and use the following maven command syntax on command shell / linux shell to create the Aspose APIs repository into your project.

For configuring Aspose.Words with Maven :

mvn deploy:deploy-file -Durl=file:asposeapi/ -Dfile=lib/aspose-words-14.4.1-jdk16.jar -DgroupId=com.aspose -DartifactId=aspose.words -Dpackaging=jar -Dversion=14.4.1

 

As you can see you have to specify correct downloaded api jar (aspose-words-14.4.1-jdk16.jar) for Aspose.Words for configuring it with Maven.

For configuring Aspose.Email, Aspose.Cells and Aspose.Barcode, you have to repeat the same command with the correct jar file names, version id and artifactId for later specifying into Maven configuration as project dependencies.

Having created Aspose API repository into your project you then need to specify the repository location (asposeapis) into your Maven dependencies configuration file (pom.xml) as below:

 <repositories>
        <repository>
            <id>aspose.com</id>
            <name>AsposeAPI</name>
            <url>file:${project.basedir}/asposeapis</url>
        </repository>
 </repositories>

And dependencies as below:

 <dependencies>
        <dependency>
            <groupId>com.aspose</groupId>
            <artifactId>aspose.pdf.kit</artifactId>
            <version>4.7.0</version>
        </dependency>
        <dependency>
            <groupId>com.aspose</groupId>
            <artifactId>aspose.pdf.jdk</artifactId>
            <version>14</version>
        </dependency>
        <dependency>
            <groupId>com.aspose</groupId>
            <artifactId>aspose.words</artifactId>
            <version>14.4.1</version>
        </dependency>
        <dependency>
            <groupId>com.aspose</groupId>
            <artifactId>aspose.cells</artifactId>
            <version>8.0.2</version>
        </dependency>
        <dependency>
            <groupId>com.aspose</groupId>
            <artifactId>aspose.email</artifactId>
            <version>4.1.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.aspose</groupId>
            <artifactId>aspose.barcode</artifactId>
            <version>5.8.0</version>
        </dependency>
        <dependency>

     ..... .....

 <dependencies>

Note: Please refer to pom.xml file comes with this project source code for the recommended method of defining Aspose Maven Depedencies through Aspose Cloud Maven Repository.

Afterward you can delete lib folder you created for copying downloaded Aspose APIs jars, as now you have created Aspose API maven repository you don't need it.

Your Maven Aspose APIs repository may look like this once you finished:

AsposeAPI Maven Repository Example

You can now further look into AsposeAPI.java source came with this project for the Aspose APIs examples and usage.


Recommended Links

Last edited Sep 19, 2014 at 3:55 PM by AdeelIlyas, version 11