Java Module System — Introduction

Folder Structure
module com.company.project.model {}
module com.company.project.model {requires java.base;exports com.company.project.model;//exports com.company.project.model to com.company.project.client}
module com.company.project.service {requires transitive com.company.project.model;exports com.company.project.service;}module com.company.project.serviceimpl {requires com.company.project.service;requires httpclient;}
open module com.company.project.serviceimpl {}
module com.company.project.foo {opens com.company.project.foo.package1;opens com.company.project.foo.package2 to com.company.project1.bar.package3;}
module com.company.project.serviceimpl {provides com.company.project.service.ProductService with  com.company.project.serviceimpl.ProductServiceImpl;exports com.company.project.serviceimpl;}
module com.company.project.yourapp {requires com.company.project.service;uses com.company.project.service.ProductService;}

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store