Skip to content

[SCB-194] Spring default scan main class package#772

Merged
liubao68 merged 4 commits intoapache:masterfrom
wujimin:spring-default-scan-main-class-package
Jun 21, 2018
Merged

[SCB-194] Spring default scan main class package#772
liubao68 merged 4 commits intoapache:masterfrom
wujimin:spring-default-scan-main-class-package

Conversation

@wujimin
Copy link
Contributor

@wujimin wujimin commented Jun 20, 2018

available for oracle and open jdk, and maybe other jdks.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 87.222% when pulling ab8890b on wujimin:spring-default-scan-main-class-package into 861e198 on apache:master.

scanPackags.add(SCB_PACKAGE);

// add main class package
Class<?> mainClass = JvmUtils.findMainClass();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the main class is put into "a.b.c.main" and most the components are put into "a.b.c"?
Can we define the scan path like the @SpringBootApplication basePackages provides in the Beans.init() method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes
but maybe invoke System.setProperty("scb-scan-package", "a.b.c") before BeanUtils.init is enough?

@liubao68 liubao68 merged commit 9147c70 into apache:master Jun 21, 2018
@wujimin wujimin deleted the spring-default-scan-main-class-package branch July 11, 2018 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants