Git Product home page Git Product logo

Comments (4)

h2mch avatar h2mch commented on July 19, 2024

I don't know gradle well, but I think you should call
mvn compile web3j:generate-sources

from web3j-maven-plugin.

k06a avatar k06a commented on July 19, 2024
$ mvn compile web3j:generate-sources
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.108 s
[INFO] Finished at: 2018-02-07T09:44:18+03:00
[INFO] Final Memory: 8M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/Users/k06a/Projects/base-node). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException

from web3j-maven-plugin.

k06a avatar k06a commented on July 19, 2024

Trying to call this maven goal from gradle:

// https://github.com/web3j/web3j-maven-plugin
// https://github.com/dkorotych/gradle-maven-exec-plugin
task compileSolidity(type: MavenExec) {
    System.out.println("test")
    goals 'web3j:generate-sources'
    options {
        define = [
            'packageName'         : 'com.bitclave.node.solidity',
            'sourceDestination'   : 'src/main/java/generated',
            'nativeJavaType'      : 'true',
            'soliditySourceFiles' : [
                'directory' : 'src/main/resources',
                'includes' : [ '**/*.sol' ]
            ]
        ]
    }
}

compileJava.doFirst {
    tasks.compileSolidity.execute()
}

from web3j-maven-plugin.

k06a avatar k06a commented on July 19, 2024

Found working solution:

buildscript {
    ext {
        kotlinVersion = '1.2.21'
        springBootVersion = '1.5.9.RELEASE'
    }
    repositories {
        mavenCentral()
        maven { url 'https://dl.bintray.com/ethereum/maven/' }
        maven { url 'https://plugins.gradle.org/m2/' }
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
        classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}")
        classpath("gradle.plugin.com.github.dkorotych.gradle.maven.exec:gradle-maven-exec-plugin:1.2.1")
    }
}

apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'maven'
apply plugin: 'com.github.dkorotych.gradle-maven-exec'

// https://github.com/web3j/web3j-maven-plugin
// https://github.com/dkorotych/gradle-maven-exec-plugin
task compileSolidity(type: MavenExec) {
    mavenexec {
        workingDir projectDir
        goals 'org.web3j:web3j-maven-plugin:generate-sources'
        options {
            file = file('pom-for-generation.xml')
            define = [
                'packageName'        : 'com.bitclave.node.solidity',
                'sourceDestination'  : 'src/main/java/generated',
                'nativeJavaType'     : 'true'
            ]
        }
    }
}

compileJava.doFirst {
    tasks.compileSolidity.execute()
}

from web3j-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.