Rod McLaughlin

You thought you'd escaped from the Maven Java dependency tool... (17 may 18)

It's many years since I had to deal with the Java dependency management tool Maven. But I'm trying to write a program in Elixir which decodes Bitcoin transactions. I can't make sense of the documentation, so what I need is code - in any language, which I can translate. "BitcoinJ" looks quite comprehensive. It's written in Java. Unfortunately, it depends on google.common, which depends on guava, which depends on 'mvn install', which runs for about an hour, then produces this:

[ERROR] Plugin org.codehaus.mojo:build-helper-maven-plugin:1.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:build-helper-maven-plugin:jar:1.7: Could not transfer artifact org.codehaus.mojo:build-helper-maven-plugin:pom:1.7 from/to central ( Connection reset -> [Help 1]

On second thoughts, it's the tests which have failed. It actually built the jars, so I'll try them. I know they were built by Maven, because they have the word "SNAPSHOT" in their names. Normally, failing tests means there's something wrong. But this is Java, so I knew that already.

To be fair, the BitcoinJ developers say you should use Gradle instead of "the aging Maven": But when you run 'gradle build' it says

> Could not find method compile() for arguments [org.bitcoinj:bitcoinj-core:0.14.7] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.


I have to eat humble pie. I read the file. It suggested doing this:

cd examples
mvn exec:java -Dexec.mainClass=org.bitcoinj.examples.ForwardingService 
                      -Dexec.args="<insert a bitcoin address here>"

I ran

mvn exec:java -Dexec.mainClass=org.bitcoinj.examples.ForwardingService 


mvn exec:java -Dexec.mainClass=org.bitcoinj.examples.FetchBlock 

and it produced a lot of interesting output. It depends on bitcoind running. See

Portland London