hyperledger / web3j-maven-plugin

web3j Maven plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

web3j plugin solidity source file compile failed with assign solidity version over 0.7.1

cqfxchina opened this issue · comments

sol file:

pragma solidity ^0.8.4;

IDEA Solidity plugin version:

2.3.8

Os System:

win 10

pom.xml info:

            <plugin>
                <groupId>org.web3j</groupId>
                <artifactId>web3j-maven-plugin</artifactId>
                <version>4.8.7</version>
                <configuration>
                    <packageName>com.web3j.model</packageName>
                    <nativeJavaType>true</nativeJavaType>
                    <outputFormat>java,bin,abi</outputFormat>
                    <soliditySourceFiles>
                        <directory>src/main/resources</directory>
                        <includes>
                            <include>**/*.sol</include>
                        </includes>
                    </soliditySourceFiles>
                    <abiSourceFiles>
                        <directory>src/main/resources</directory>
                        <includes>
                            <include>**/*.json</include>
                        </includes>
                    </abiSourceFiles>
                    <outputDirectory>
                        <java>src/main/generated/java/</java>
                        <bin>src/bin/generated</bin>
                        <abi>src/abi/generated</abi>
                    </outputDirectory>
                    <contract>
                        <includes>
                            <include>greeter</include>
                        </includes>
                        <excludes>
                            <exclude>mortal</exclude>
                        </excludes>
                    </contract>
                    <pathPrefixes>
                        <pathPrefix>dep=../dependencies</pathPrefix>
                    </pathPrefixes>
                </configuration>
            </plugin>

compile error msg:

Could not compile Solidity files
Error: Source file requires different compiler version (current compiler is 0.7.1+commit.f4a555be.Windows.msvc) - note that nightly builds are considered to be strictly less than the released version
 --> F:/intellij_workspace/web3/xkqweb3j/src/main/resources/Tmp.sol:3:1:
  |
3 | pragma solidity ^0.8.4;
  | ^^^^^^^^^^^^^^^^^^^^^^^

### 1. how to change the solidity complier version by manual ?

I has rebuild the web3j-sokt to resolved