private File writeClassworlds( String rawClassPath ) { ClassworldsRealmConfiguration rootRealmConfig = new ClassworldsRealmConfiguration( "wagon" ); rootRealmConfig.addLoadPatterns( Arrays.asList( rawClassPath.split( File.pathSeparator ) ) ); ClassworldsAppConfiguration config = new ClassworldsAppConfiguration(); config.setMainClass( WagonDeployer.class.toString() ); config.addRealmConfiguration( rootRealmConfig ); config.setMainRealm( rootRealmConfig.getRealmId() ); ClassworldsValidationResult vr = new ClassworldsModelValidator().validate( config ); if ( vr.hasErrors() ) { throw new RuntimeException( vr.render() ); } File classworldsConf = new File( "target/wagonDeploy/", "classworlds.conf" ); classworldsConf.getParentFile().mkdirs(); try { new ClassworldsConfWriter().write( classworldsConf, config ); } catch ( ClassworldsIOException e ) { throw new RuntimeException( e.getMessage(), e ); } return classworldsConf; }
private File writeConfig( ClassworldsAppConfiguration config ) throws AppBooterServiceException { File classworldsConf = new File( tempDir, "classworlds.conf" ); try { ClassworldsConfWriter writer = new ClassworldsConfWriter(); Properties velocityProperties = writer.getDefaultVelocityProperties(); VelocityLogChute.setPlexusLogger( getLogger() ); velocityProperties.setProperty( "runtime.log.logsystem.class", VelocityLogChute.class.getName() ); writer.write( classworldsConf, config, velocityProperties ); getLogger().info( "Wrote classworlds.conf to: " + classworldsConf ); } catch ( ClassworldsIOException e ) { throw new AppBooterServiceException( e.getMessage(), e ); } if ( outputDebugMessages() ) { getLogger().info( "Saving Classworlds configuration at: " + classworldsConf.getAbsolutePath() ); } return classworldsConf; }
private File writeConfig( ClassworldsAppConfiguration config ) throws AppBooterServiceException { File classworldsConf = new File( tempDir, "classworlds.conf" ); try { ClassworldsConfWriter writer = new ClassworldsConfWriter(); Properties velocityProperties = writer.getDefaultVelocityProperties(); VelocityLogChute.setPlexusLogger( getLogger() ); velocityProperties.setProperty( "runtime.log.logsystem.class", VelocityLogChute.class.getName() ); writer.write( classworldsConf, config, velocityProperties ); getLogger().info( "Wrote classworlds.conf to: " + classworldsConf ); } catch ( ClassworldsIOException e ) { throw new AppBooterServiceException( e.getMessage(), e ); } if ( outputDebugMessages() ) { getLogger().info( "Saving Classworlds configuration at: " + classworldsConf.getAbsolutePath() ); } return classworldsConf; }