トップ  >  リファレンス  >  APIを取得して始める  >  JForex SDKを使う >  NetBeans(IDE)を使う >  Mavenチュートリアル(NetBeans)
Mavenチュートリアル(NetBeans)

NetBeansIDEのApache MavenプロジェクトをJForex-SDKで作成する方法を説明します。
The main advantage of using Maven is that in order to switch to the latest JForex-SDK version one only needs to change the DDS2-jClient-JForex version number in the pom.xml configuration file rather than download the zip file and import it as a new project. See Strategy development in NetBeans for more information on working with NetBeans and JForex-SDK.


Check configuration

Before creating a Maven project in NetBeans, one needs to verify if NetBeans already has Maven plugin installed. For the latest versions of NetBeans the Maven plugin comes bundled in by default, as it is in our case. For older NetBeans versions one can install the plugin by choosing Tools -> Plugins -> Available Plugins. If you are using proxy to access the internet, then the proxy settings should be configured in NetBeans through Tools -> Options -> General -> Proxy Settings.







Create a Maven Project

In order to create a Maven project in the NetBeans, we need only one file, namely, a project object model (POM) file. The POM file used in this tutorial includes all necessarily properties to build the JForex-SDK project and work with the public Dukascopy Maven repository. Here are the contents of POM file we are using in this example:



<?xml version="1.0" encoding="UTF-8"?>

<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.dukascopy.dds2</groupId>
    <artifactId>JForex-SDK-Local-Maven</artifactId>
    <version>1.0</version>
    <name>JForex-SDK-MAVEN</name>
    <description></description>
    <organization>
        <name>DUKASCOPY (Suisse) SA</name>
        <url>http://www.dukascopy.com</url>
    </organization>
    <repositories>
        <repository>
            <id>dc_public</id>
            <name>Dukascopy public repository</name>
            <url>http://www.dukascopy.com/client/jforexlib/publicrepo/</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>com.dukascopy.dds2</groupId>
            <artifactId>DDS2-jClient-JForex</artifactId>
            <version>2.18</version>
        </dependency>
    </dependencies>
    <build>
        <sourceDirectory>src</sourceDirectory>
        <finalName>JForex-SDK</finalName>
    </build>
</project>




Consider the following steps:
  • Make a new file, name it pom.xml and paste the to it the upper given contents. Put this file in an empty directory.
  • Open NetBeans and press Ctrl+Shift+O (or choose File -> Open Project) to open a new project. Locate for the directory in which the pom.xml file is located. NetBeans will automatically recognize this directory as a Maven project. Select the project and choose Open Project. NetBeans will create a new Maven project called JForex-SDK-Maven.
  • Right-click the project in the Projects window and choose Clean and Build. NetBeans will build the project.
  • One can expand the project node and see that the project already has dependencies. These dependencies (libraries) are stored in the public Maven repository of Dukascopy.





Create and Run a Program









Test the Program









Keep Dependencies up to Date








スポンサーリンク

スポンサーリンク
検索
リファレンスツリー


Copyright ©2016 JForexAPIで自動売買させ隊! All Rights Reserved.


Top

inserted by FC2 system