Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Deploying maven project in netbeans
 Post subject: Deploying maven project in netbeans Post rating: 0   New post Posted: Wed 06 Mar, 2013, 11:39 

User rating: 1
Joined: Thu 23 Feb, 2012, 11:22
Posts: 23
Hi,

I have created a JForexSDK project as an Apache Maven project in the NetBeans IDE.

All is working as it should while running the project from within the IDE.

I am attempting to deploy the project using an executable jar file.

After doing a clean and build the Manifest file has no main class or library dependencies.

Is any additional coding required in the pom.xml file to accomplish this?

Any help would be appreciated.

Regards

Mark


 
 Post subject: Re: Deploying maven project in netbeans Post rating: 0   New post Posted: Wed 06 Mar, 2013, 11:44 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See:
https://forums.netbeans.org/topic15830.html


 
 Post subject: Re: Deploying maven project in netbeans Post rating: 0   New post Posted: Wed 06 Mar, 2013, 14:10 

User rating: 1
Joined: Thu 23 Feb, 2012, 11:22
Posts: 23
Hi Support,

I have made a little progress,

I added the following to the pom.xls file,
---------------------------
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>utils.Main_Form</mainClass>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
<descriptorRefs>
<descriptorRefs>JForex-SDK-2.24</descriptorRefs>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>utils.Main_Form</mainClass>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>
</plugin>
--------------------------------------
The Manifest file now reads,

Manifest-Version: 1.0
Implementation-Title: JForex-SDK
Implementation-Version: 2.24
Built-By: Mark
Class-Path: DDS2-jClient-JForex-2.24.jar DDS2-Charts-5.92.jar patterns
-1.2.jar greed-common-218.jar MQL4Connector-2.7.9.jar JForex-API-2.7.
9.jar MQL4Converter-1.17.jar commons-lang3-3.0.1.jar jna-3.5.0.jar tr
ansport-client-2.4.19.jar dds2-common-2.4.19.jar mina-core-1.1.7.jar
mina-filter-ssl-1.1.7dc.1.jar jcalendar-1.3.3.jar DDS2-TextEditor-1.1
8.jar jakarta-oro-2.0.8.jar lucene-core-3.4.0.jar lucene-highlighter-
3.4.0.jar lucene-memory-3.4.0.jar lucene-queries-3.4.0.jar jakarta-re
gexp-1.4.jar ecj-3.5.2.jar ta-lib-0.4.4dc.jar 7zip-4.65.jar JForex-AP
I-2.7.9-sources.jar slf4j-log4j12-1.6.4.jar slf4j-api-1.6.4.jar log4j
-1.2.16.jar
Specification-Vendor: Dukascopy Bank SA
Created-By: Apache Maven 3.0.4
Implementation-Vendor: Dukascopy Bank SA
Implementation-Vendor-Id: com.dukascopy.dds2
Build-Jdk: 1.7.0_02
Specification-Title: JForex-SDK
Specification-Version: 2.24
Main-Class: utils.Main_Form
Archiver-Version: Plexus Archiver


The main form is now launched when I double click on the executable Jar file but nothing else works.

Previously when building projects for deployment with netbeans a dist folder was created containing the executable jar file and a lib folder containing all the library files.

I’m not sure what is meant to happen when deploying the maven project?

Regards

Mark


 
 Post subject: Re: Deploying maven project in netbeans Post rating: 0   New post Posted: Thu 07 Mar, 2013, 15:37 

User rating: 1
Joined: Thu 23 Feb, 2012, 11:22
Posts: 23
Hi All,

I added the following to the pom file. This seems to work.

I now have an executable jar file which includes all the dependencies for deployment.

Still testing but so far so good.

Regards

Mark


<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>utils.Main_Form</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com