Practical overview
When it fits
Use it when a Java Maven project needs generated contract classes from Solidity sources as part of its source-generation workflow.
Who it is for
- Java developers building Maven projects that use smart contracts
- Teams that want contract wrapper generation as part of a Maven build
Documented uses
- Generate Java classes from Solidity contract files.
- Choose package names and generated-file destinations.
- Select Java, ABI and/or BIN outputs and filter contracts.
Requirements & limits
The project is published as a public GitHub repository and identifies its license as Apache-2.0.
- The documented Maven goal is generate-sources.
- Default Solidity inputs are read from src/main/resources and default Java output goes to src/main/java.
- Output formats can include Java, ABI and BIN; outputDirectory settings take precedence over sourceDestination.
- The plugin generates bindings; the README points to separate web3j documentation for deploying and interacting with contracts.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Generate Java classes from Solidity sources in Maven
Configure the plugin in a Java Maven project and invoke its documented source-generation goal.
Before you start
- A standard Java Maven project
- Solidity contract files ending in .sol
- The web3j Maven plugin added to the project's pom.xml
Steps
Add the plugin under the Maven build's plugins, using groupId org.web3j and artifactId web3j-maven-plugin.
Place Solidity files in src/main/resources, or configure the source files and locations you want the plugin to use.
Optionally set the generated package, output formats, output directories, and contract include or exclude filters in the plugin configuration.
Run mvn web3j:generate-sources.
Expected outcome
The plugin generates Java classes from the selected contract files; its default Java output location is src/main/java.
Guide limitations
- The documented base configuration generates Java classes by default; ABI and BIN output must be selected through outputFormat.
- The README describes generation, while deployment and contract interaction are covered in separate web3j documentation.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 11 October 2026
- Original website title
- LFDT-web3j/web3j-maven-plugin · Official homepage title · retained in its source language

