private Store getStore ( MavenProject rootModule ) throws MojoExecutionException { StoreConfiguration configuration = getStoreConfiguration ( rootModule ) ; List < Class < ? > > descriptorTypes ; try { descriptorTypes = pluginRepositoryProvider . getPluginRepository ( ) . getModelPluginRepository ( ) . getDescriptorTypes ( ) ; } catch ( PluginRepositoryException e ) { throw new MojoExecutionException ( "Cannot determine model types." , e ) ; } Object existingStore = cachingStoreProvider . getStore ( configuration , descriptorTypes ) ; if ( ! Store . class . isAssignableFrom ( existingStore . getClass ( ) ) ) { throw new MojoExecutionException ( "Cannot re-use store instance from reactor. Either declare the plugin as extension or execute Maven using the property -D" + PROPERTY_STORE_LIFECYCLE + "=" + StoreLifecycle . MODULE + " on the command line." ) ; } return ( Store ) existingStore ; }
Determine the store instance to use for the given root module .