nuun-io / kernel

Nuun Kernel is an IOC component for creation of powerfull enterprise stack.
Other
8 stars 5 forks source link

Add packageRoot on configuration #59

Closed pith closed 8 years ago

pith commented 8 years ago

Add a packageRoot(String...) method on KernelConfiguration. It will be easier to discover than with the curent param() method.

Also add a warn when no packageRoot is specified.

========================== WARNING ==========================
Please update your application package root inside 
     → /META-INF/resources/nuun.conf
with 
     →  nuun.package.root = com.acme1, com.acme2

You're actually scanning the WHOLE classpath 
========================== WARNING ==========================

See #58 for previous discussion.

pith commented 8 years ago

A new param param("scan.warn.disable", true) (false by default) should be added.

ejemba commented 8 years ago

The warning message should be updated like this

================================ WARNING ================================
   You're actually scanning the WHOLE classpath , this can be time consuming.
   Please update your application configuration, to narrow the scan to your application.

 1) You can update /nuun.conf in the classpath with the following content

          rootPackage = com.acme1, com.acme2

   where com.acme1 and com.acme2 are your root packages.

 2) You can programmatically use KernelConfiguration.rootPackage("com.acme1" , "com.acme2")

   Same as above

 3) You can programmatically use KernelConfiguration.param("scan.warn.disable" , "true")

   This will disable the warning. It implies, you know what you are doing.

========================================================================
pith commented 8 years ago

So you want to deprecate the pluginPackageRoot() method ?

BTW maybe rootPackages() with an S would be better

ejemba commented 8 years ago

Yes deprecate it in order to have the clean api for the 1.0. Yes rootPackages() is better.

pith commented 8 years ago

Ok I started a branch: https://github.com/nuun-io/kernel/tree/fix-59-rootPackages