uniVocity / univocity-trader

open-source trading framework for java, supports backtesting and live trading with exchanges
578 stars 140 forks source link

Build fails if you don't have Interactive Brokers jar #121

Closed drkarl closed 3 years ago

drkarl commented 3 years ago

When trying to run the build without having the Interactive Brokers jar on the classpath you get this error message

[INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for univocity-trader 1.0.0-SNAPSHOT: [INFO] [INFO] univocity-trader ................................... SUCCESS [ 1.213 s] [INFO] univocity-trader-core .............................. SUCCESS [ 11.431 s] [INFO] univocity-trader-binance ........................... SUCCESS [ 1.321 s] [INFO] univocity-trader-binance-futures ................... SUCCESS [ 1.690 s] [INFO] univocity-trader-iqfeed ............................ SUCCESS [ 0.890 s] [INFO] univocity-trader-examples .......................... FAILURE [ 0.046 s] [INFO] univocity-trader-chart ............................. SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 16.760 s [INFO] Finished at: 2021-03-01T23:55:41Z [INFO] ------------------------------------------------------------------------

Given that jar can't be bundled since you have to download and accept terms and conditions, and that some users may not be interested in using IB, you have to comment pom.xml in examples module (reference to IB dependency) and imports in a couple of classes.

That means that by defauilt, after project checkout, doing a mvn clean install or mvn clean package will fail, and you'll have to figure out why. You have to comment things related to IB in 3 files, so it's easy to fix, but it's not obvious and it's not documented on README.md

I wonder if we could conditionally exclude that from compilation, for example by using profiles or the maven-build-helper.

drkarl commented 3 years ago

@jbax can we move the 2 interactive brokers examples (LiveForexTrader and ForexMarketSimulator) from the examples module to the interactive brokers module? That way it won't break the build if you don't have the interactive brokers jar, and you don't have to go and comment the dependency and the 2 classes.

jbax commented 3 years ago

Yes that's a good idea

On Fri, Mar 5, 2021, 11:49 AM drkarl notifications@github.com wrote:

@jbax https://github.com/jbax can we move the 2 interactive brokers examples (LiveForexTrader and ForexMarketSimulator) from the examples module to the interactive brokers module? That way it won't break the build if you don't have the interactive brokers jar, and you don't have to go and comment the dependency and the 2 classes.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/uniVocity/univocity-trader/issues/121#issuecomment-791072244, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWFQPSW5IMHTGQKIEWPQRDTCAWRTANCNFSM4YNTGUDA .