@Override public void configureNexus() { final Properties nexusProperties = new Properties(); nexusProperties.setProperty("application-port", String.valueOf(getPort())); nexusProperties.setProperty("application-port-ssl", String.valueOf(getSslPort())); nexusProperties.setProperty(commandMonitorProperty(), String.valueOf(commandMonitorPort)); nexusProperties.setProperty(keepAliveProperty(), String.valueOf(keepAlivePort)); if (getConfiguration().getContextPath() != null) { nexusProperties.setProperty("nexus-webapp-context-path", getConfiguration().getContextPath()); } final Map<String, String> systemProperties = getConfiguration().getSystemProperties(); if (!systemProperties.isEmpty()) { for (final Map.Entry<String, String> entry : systemProperties.entrySet()) { nexusProperties.setProperty(entry.getKey(), entry.getValue() == null ? "true" : entry.getValue()); } } onDirectory(getConfiguration().getTargetDirectory()).apply( fileTaskBuilder.properties(path("nexus/conf/nexus-test.properties")) .properties(nexusProperties) ); }
@Override public void configureNexus() { onDirectory(getConfiguration().getTargetDirectory()).apply( fileTaskBuilder.properties(path("nexus/conf/nexus.properties")) .property("application-port", String.valueOf(getPort())) ); }
fileTaskBuilder.copy() .directory(file(plugin)) .to().directory(path("sonatype-work/nexus/plugin-repository")) ); overlays.add( fileTaskBuilder.expand(file(plugin)) .to().directory(path("sonatype-work/nexus/plugin-repository")) ); overlays.add( fileTaskBuilder.replace() .inFile(path("nexus/conf/jetty.xml")) .replace( "org.sonatype.nexus.bootstrap.jetty.InstrumentedSelectChannelConnector", fileTaskBuilder.properties(path("sonatype-work/nexus/conf/logback.properties")) .property("root.level", getLogLevel() == null ? DEFAULT_LOG_LEVEL : getLogLevel()) .property("appender.pattern", getLogPattern() == null ? DEFAULT_LOG_PATTERN : getLogPattern()) writer.flush(); overlays.add( fileTaskBuilder.create().file(path("sonatype-work/nexus/conf/logback-test.xml")) .containing(baos.toString("UTF-8")) .encodedAs("UTF-8") overlays.add( fileTaskBuilder.replace() .inFile(path("nexus/conf/jetty-https.xml"))
private void makeExecutable(final File baseDir, final String scriptName) { if (!Os.isFamily(Os.FAMILY_WINDOWS)) { onDirectory(baseDir).apply( fileTaskBuilder.chmod(path("/")) .include("**/" + scriptName) .permissions("u+x") ); } }
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() ) ) ); } } }
onDirectory(nexusDir).apply( fileTaskBuilder.exec().spawn() .script(path("bin/nexus" + (Os.isFamily(Os.FAMILY_WINDOWS) ? ".bat" : ""))) .withArgument("console") .withEnv(strategy.commandMonitorProperty(), String.valueOf(commandMonitorPort))