You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have 3 modules, in this one module name is common.
common
|- datatype
|- infrastructure
|- enums
|- Aggregates
common module has different packages. As this module in common its internal classes of internal packages should be easily accessible.
However using modulith, module. verify fails when I try to use an enum from this common module in any other module.
I can able to resolve this by adding package-info into each subpackage of common module e.g
@org.springframework.modulith.NamedInterface("datatype")
package com.common.datatype;
however, adding package-info into each package is not a clean solution. is there any other way where I could mention this is a shared module so the modularity test should not fail?
Already tried with but it did not work. @Modulithic(sharedModules = "com.common")
public class Application {
I'm not sure because I haven't tested it, but @Modulthic::sharedModule seems to write the correct package name. {com.common.enum,com.comm.datatype…} like this. In the case of Java's package, it looks hierarchical to see, but I know it is actually recognized as a separate, independent place.
I haven't tested it, so try it.
tried @Modulithic(sharedModules = "com.common", additionalPackages = "com.common.datatype", useFullyQualifiedModuleNames = true) but it does not work without packge-info. getting
org.springframework.modulith.core.Violations: - Module 'com.other' depends on non-exposed type com..common.datatype.testdata within module 'com.common'!
Activity
onjik commentedon Nov 10, 2023
I'm not sure because I haven't tested it, but @Modulthic::sharedModule seems to write the correct package name. {com.common.enum,com.comm.datatype…} like this. In the case of Java's package, it looks hierarchical to see, but I know it is actually recognized as a separate, independent place.
I haven't tested it, so try it.
shreyy1234 commentedon Nov 10, 2023
tried @Modulithic(sharedModules = "com.common", additionalPackages = "com.common.datatype", useFullyQualifiedModuleNames = true) but it does not work without packge-info. getting
org.springframework.modulith.core.Violations: - Module 'com.other' depends on non-exposed type com..common.datatype.testdata within module 'com.common'!