Skip to content

Instantly share code, notes, and snippets.

@o
Created May 30, 2016 16:37
Show Gist options
  • Save o/86f205c5172f40c12c63d9121b26d861 to your computer and use it in GitHub Desktop.
Save o/86f205c5172f40c12c63d9121b26d861 to your computer and use it in GitHub Desktop.

I'd done a lot of Boot projects before. But never tried multi-module structure.

Here is the my sample structure

Parent project: com.github.o.parent

Just declares org.springframework.boot-spring-boot-autoconfigure

Common project: com.github.o.common

Holds entities, repositories and repository related service classes. Only have a configuration class for HikariCP data source. Question: Which annotations (especially JPA related) right for this configuration class?

Rest project: com.github.o.rest

Depends to JPA project. Needs to use common project service classes. Also have a Application class with SpringBootApplication. Question: Same, which annotations needed for scanning common project services and repositories.

I'd tried different annotations / configurations but i can't inject a repository from common project.

Thanks.

@wbiller
Copy link

wbiller commented May 30, 2016

Actually this also works well for monolithic applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment