import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.BooleanUtils;
+import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.SystemUtils;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
boolean generatePom )
throws ArchivaRestServiceException
{
- repositoryId = StringUtils.trim( repositoryId );
- groupId = StringUtils.trim( groupId );
- artifactId = StringUtils.trim( artifactId );
- version = StringUtils.trim( version );
- packaging = StringUtils.trim( packaging );
+ repositoryId = StringEscapeUtils.escapeJavaScript( StringUtils.trim( repositoryId ) );
+ groupId = StringEscapeUtils.escapeJavaScript( StringUtils.trim( groupId ) );
+ artifactId = StringEscapeUtils.escapeJavaScript( StringUtils.trim( artifactId ) );
+ version = StringEscapeUtils.escapeJavaScript( StringUtils.trim( version ) );
+ packaging = StringEscapeUtils.escapeJavaScript( StringUtils.trim( packaging ) );
checkParamChars("repositoryId", repositoryId);
checkParamChars("groupId", groupId);
ManagedRepository repoConfig = managedRepositoryAdmin.getManagedRepository( repositoryId );
+ repositoryId = StringEscapeUtils.escapeJavaScript( StringUtils.trim( repositoryId ) );
+ groupId = StringEscapeUtils.escapeJavaScript( StringUtils.trim( groupId ) );
+ artifactId = StringEscapeUtils.escapeJavaScript( StringUtils.trim( artifactId ) );
+ version = StringEscapeUtils.escapeJavaScript( StringUtils.trim( version ) );
+ packaging = StringEscapeUtils.escapeJavaScript( StringUtils.trim( packaging ) );
+
ArtifactReference artifactReference = new ArtifactReference();
artifactReference.setArtifactId( artifactId );
artifactReference.setGroupId( groupId );
import org.apache.archiva.web.api.FileUploadService;
import org.apache.archiva.web.model.FileMetadata;
import org.apache.catalina.Context;
-import org.apache.catalina.LifecycleException;
import org.apache.catalina.deploy.ApplicationParameter;
import org.apache.catalina.startup.Tomcat;
import org.apache.commons.io.FileUtils;
meta = service.post( body );
log.debug( "Metadata {}", meta.toString( ) );
try {
- service.save("internal", "org", URLEncoder.encode("../../../test", "UTF-8"), URLEncoder.encode("testSave", "UTF-8"), "4", true);
+ service.save("internal", "org",
+ URLEncoder.encode("../../../test", "UTF-8"),
+ URLEncoder.encode("testSave", "UTF-8"), "4", true);
fail("Error expected, if the content contains bad characters.");
} catch (ClientErrorException e) {
assertEquals(422, e.getResponse().getStatus());
<archiva.repositorySessionFactory.id>jcr</archiva.repositorySessionFactory.id>
<cassandra.host>localhost</cassandra.host>
<cassandra.port>9160</cassandra.port>
+ <tomcat7Version>7.0.76</tomcat7Version>
</properties>
<dependencies>
<org.apache.sirona.configuration.sirona.properties>${archiva.sirona.configuration}</org.apache.sirona.configuration.sirona.properties>
<AsyncLoggerConfig.WaitStrategy>Block</AsyncLoggerConfig.WaitStrategy>
<AsyncLogger.WaitStrategy>Block</AsyncLogger.WaitStrategy>
+ <tomcat.util.scan.DefaultJarScanner.jarsToSkip>log4j-*.jar</tomcat.util.scan.DefaultJarScanner.jarsToSkip>
</systemProperties>
<additionalClasspathDirs>
<additionalClasspathDir>${basedir}/src/test/tomcat</additionalClasspathDir>
<artifactId>mail</artifactId>
<version>${javaxMailVersion}</version>
</dependency>
+ <!-- insane but needed because of this https://bz.apache.org/bugzilla/show_bug.cgi?id=60688 -->
+ <dependency>
+ <groupId>org.apache.tomcat.embed</groupId>
+ <artifactId>tomcat-embed-core</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-util</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-coyote</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-api</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jdbc</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-dbcp</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-servlet-api</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jsp-api</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jasper</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jasper-el</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-el-api</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-catalina</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-tribes</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-catalina-ha</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-annotations-api</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+
+ <!-- tomcat i18n too ?? -->
+
+ <!-- not sure we need that -->
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-juli</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat.embed</groupId>
+ <artifactId>tomcat-embed-logging-juli</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat.embed</groupId>
+ <artifactId>tomcat-embed-logging-log4j</artifactId>
+ <version>${tomcat7Version}</version>
+ </dependency>
</dependencies>
</plugin>