private void removePluginsPresentInBundle() { final Map<String, File> workDirPlugins = listPlugins( new File(getWorkDirectory(), "plugin-repository") ); if (workDirPlugins.size() > 0) { final Map<String, File> bundlePlugins = listPlugins( new File(getNexusDirectory(), "nexus/WEB-INF/plugin-repository") ); for (final Map.Entry<String, File> entry : workDirPlugins.entrySet()) { if (bundlePlugins.containsKey(entry.getKey())) { log.info( "{} ({}) removing plugin '{}' already present in extracted bundle", getName(), getConfiguration().getId(), entry.getValue().getName() ); fileTaskBuilder.delete().directory(file(entry.getValue())).run(); } } } }
this.fileTaskBuilder.chmod( file( binDir ) ) .exclude( "**/*.bat" ) .exclude( "**/*.dll" )
private void makeScriptsExecutable() { final File binDir = new File( getConfiguration().getTargetDirectory(), getName() + "/bin" ); getFileTaskBuilder().chmod( file( binDir ) ) .include( "**/*.sh" ) .permissions( "u+x" ) .run(); }
getFileTaskBuilder().copy() .file( file( serverXml ) ) .to().file( path( getName() + "/etc/jetty.xml" ) ) .filterUsing( "port.https", String.valueOf( httpsPort ) ) .filterUsing( "port.http", String.valueOf( getPort() ) )
@Override protected void createBundle() { BundleConfiguration config = getConfiguration(); File bundle = config.getBundle(); if ( bundle == null ) { return; } if ( bundle.isDirectory() ) { onDirectory( config.getTargetDirectory() ).apply( getFileTaskBuilder().copy().directory( file( bundle ) ) .to().directory( path( "/" ) ) ); } else { onDirectory( config.getTargetDirectory() ).apply( getFileTaskBuilder().expand( file( bundle ) ) .exclude( "*/contexts/**" ) .exclude( "*/contexts-available/**" ) .exclude( "*/javadoc/**" ) .exclude( "*/overlays/**" ) .exclude( "*/webapps/**" ) .to().directory( path( "/" ) ) ); } }
private void installWARs() { final SCBC config = getConfiguration(); final List<WAR> wars = config.getWARs(); for ( WAR war : wars ) { if ( war.getFile().isDirectory() ) { onDirectory( config.getTargetDirectory() ).apply( getFileTaskBuilder().copy() .directory( file( war.getFile() ) ) .to().directory( path( getName() + "/" + getWebAppPath() + "/" + war.getContext() ) ) ); } else { onDirectory( config.getTargetDirectory() ).apply( getFileTaskBuilder().expand( file( war.getFile() ) ) .to().directory( path( getName() + "/" + getWebAppPath() + "/" + war.getContext() ) ) ); } } }