hyperledger / web3j

Lightweight Java and Android library for integration with Ethereum clients
https://www.web3labs.com/web3j-sdk
Other
5.07k stars 1.67k forks source link

No Auto-Module-Name manifest attribute and split packages #1399

Open melowe opened 3 years ago

melowe commented 3 years ago

_Issuetitle

No Auto-Module-Name manifest attribute and split packages

_Issuedescription

The lack of Auto-Module-Name manifest attribute and reusing packages across modules renders the libraries unusable in 9+ packaged applications defining module-info.

_Issuecontext

This issue means using web3j libraries is extremely limiting. One option is to create a web3j-(all|jigsaw).jar and add the auto-module-name attribute there or deal with the issue by refactoring the package names. The later will probably require more time for adoption while creating all jar with the auto module attribute will have less impacts to downstream applications.

mohamedelshami commented 3 years ago

Thanks Mark for bringing this up.

I'm not fully sure what would be the implication on the published releases and application dependent on web3j if we add support for AMN manifest to the distribution. I will discuss with the team, but happy to review PR if this needs to be fast tracked.

melowe commented 3 years ago

The broader issue is split packages. Even if web3j fixes this there i'm not sure about it's dependencies either.

MarcUserName commented 2 years ago

I have also a lot of issues getting web3j to work in a project with module-info file. The package org.web3j.crypto is contained in both core and crypto jars, which leads to issues like java.lang.module.ResolutionException at startup.

Wouldn't moving the Wallet classes from the core jar to a different package solve this issue with relatively low effort?

tretonis commented 2 years ago

But why is it so difficult to adapt to modularization?, or if you don't want to modularize, just don't have the same package path in different Jars.

Just changing the package name in different Jars solves the problem.

I want to develop using Web3J with JavaFX latest version, there must be many others thinking about developing with these libraries.

If you're still having trouble, I'll take the time to make the necessary correction.