简体   繁体   中英

How to prevent files in a Maven Java import from specific package

I have a Maven Java project with two pacakages inside src/main/java

com.myproject.maincode com.myproject.resusablecode

Is there any way either through Java or with a Maven plugin/step to prevent the files inside the "com.myproject.resusablecode" package from importing files inside the package "com.myproject.maincode"?

The proper way would be to separate the reusable code into its own project (or module) and add it as a dependency to your main code. It sounds like they have no reason to be in the same project (judging by the name).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM