Permalink
Browse files

o Initial version of Nexus Ivy support generously donated by Bosch, G…

…ermany.
  • Loading branch information...
0 parents commit f4947dacb65e5145a57f6ceb2399b793fb9624a4 Jason van Zyl committed May 3, 2012
Showing with 6,651 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +62 −0 checkstyle-suppressions.xml
  3. +20 −0 log4j.xml
  4. +18 −0 nb-configuration.xml
  5. +231 −0 pom.xml
  6. +15 −0 src/main/java/com/bosch/tmp/nexus/ivy/repository/IVYHostedRepository.java
  7. +476 −0 src/main/java/com/bosch/tmp/nexus/ivy/repository/IVYRepository.java
  8. +19 −0 src/main/java/com/bosch/tmp/nexus/ivy/repository/IVYRepositoryConfiguration.java
  9. +15 −0 src/main/java/com/bosch/tmp/nexus/ivy/repository/IVYRepositoryConfigurator.java
  10. +91 −0 src/main/java/com/bosch/tmp/nexus/ivy/repository/template/IVYHostedRepositoryTemplate.java
  11. +37 −0 src/main/java/com/bosch/tmp/nexus/ivy/repository/template/IVYRepositoryTemplateProvider.java
  12. +107 −0 src/main/java/com/bosch/tmp/nexus/ivy/repository/util/IVYArtifactRecognizer.java
  13. +371 −0 src/main/java/com/bosch/tmp/nexus/ivy/repository/util/IVYGav.java
  14. +257 −0 src/main/java/com/bosch/tmp/nexus/ivy/repository/util/IVYGavCalculator.java
  15. +881 −0 src/main/java/com/bosch/tmp/nexus/ivy/tasks/IVYDefaultSnapshotRemover.java
  16. +29 −0 src/main/java/com/bosch/tmp/nexus/ivy/tasks/IVYSnapshotRemover.java
  17. +171 −0 src/main/java/com/bosch/tmp/nexus/ivy/tasks/IVYSnapshotRemoverTask.java
  18. +127 −0 src/main/java/com/bosch/tmp/nexus/ivy/tasks/descriptors/IVYSnapshotRemovalTaskDescriptor.java
  19. +38 −0 ...a/com/bosch/tmp/nexus/ivy/tasks/descriptors/properties/IVYDeleteImmediatlyPropertyDescriptor.java
  20. +38 −0 ...m/bosch/tmp/nexus/ivy/tasks/descriptors/properties/IVYMinimumSnapshotCountPropertyDescriptor.java
  21. +39 −0 ...a/com/bosch/tmp/nexus/ivy/tasks/descriptors/properties/IVYRemoveIfReleasedPropertyDescriptor.java
  22. +39 −0 .../bosch/tmp/nexus/ivy/tasks/descriptors/properties/IVYSnapshotRetentionDaysPropertyDescriptor.java
  23. +129 −0 src/test/java/com/bosch/tmp/ivy/test/tasks/descriptors/IVYSnapshotRemovalTaskDescriptorTest.java
  24. +385 −0 src/test/java/com/bosch/tmp/nexus/integrationtests/ivyRemover/IVYRemoverTaskDeleteAllIT.java
  25. +428 −0 ...t/java/com/bosch/tmp/nexus/integrationtests/ivyRemover/IVYRemoverTaskDeleteIfReleaseExistsIT.java
  26. +360 −0 src/test/java/com/bosch/tmp/nexus/integrationtests/ivyRemover/IVYRemoverTaskDeleteImmediatlyIT.java
  27. +400 −0 ...est/java/com/bosch/tmp/nexus/integrationtests/ivyRemover/IVYRemoverTaskDeleteOlderThanDaysIT.java
  28. +377 −0 src/test/java/com/bosch/tmp/nexus/integrationtests/ivyRemover/IVYRemoverTaskTwoSnapsLeftIT.java
  29. +392 −0 src/test/java/com/bosch/tmp/nexus/ivy/test/repository/util/IVYArtifactRecognizerTest.java
  30. +244 −0 src/test/java/com/bosch/tmp/nexus/ivy/test/tasks/IVYDefaultSnapshotRemoverTest.java
  31. +178 −0 src/test/java/com/bosch/tmp/nexus/ivy/test/tasks/IVYSnapshotRemoverTaskTest.java
  32. +20 −0 src/test/resources/log4j.xml
  33. +540 −0 src/test/resources/pom.xml
  34. +10 −0 src/test/resources/resources/baseTest.properties
  35. +3 −0 src/test/resources/resources/ivyRemover/files/maven-metadata.xml
  36. +21 −0 src/test/resources/resources/ivyRemover/files/pom.xml
  37. +1 −0 src/test/resources/resources/ivyRemover/files/simple-artifact-hash.md5
  38. +1 −0 src/test/resources/resources/ivyRemover/files/simple-artifact-hash.sha1
  39. BIN src/test/resources/resources/ivyRemover/files/simple-artifact.jar
  40. +41 −0 src/test/resources/resources/ivyRemover/files/simple-artifact.pom
  41. +32 −0 src/test/resources/resources/ivyRemover/files/simple-artifact.xml
  42. +7 −0 src/test/resources/resources/testng.xml
@@ -0,0 +1 @@
+target
@@ -0,0 +1,62 @@
+<?xml version="1.0"?><!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.0//EN" "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
+<suppressions>
+
+ <!-- ======================================================================
+ PROJECT SPECIFIC SUPPRESSIONS
+
+ In this file, you can specify which warning and error from checkstyle are
+ suppressed. Not all checks are applicable in all cases. During code review,
+ the suppression of a warning/error can be agreed upon.
+
+ To suppress a check, enter a new configuration block that looks like this:
+
+ <!- 2008-12-24 lat1si Generated code ->
+ <suppress checks="LineLength" files="MyFile.java"/>
+
+ This will suppress the check named MyCheckName in the file MyFile.java. The
+ comment must contain the date (YYYY-MM-DD), the developer and a description
+ why it is ok to suppress the check.
+
+ Most common checks for suppression are:
+ - LineLength
+ - JavadocMethod
+
+ To specify the files, you can use regular expression. The regular expression
+ will be found at any position inside the full path name. There is no need to
+ specify a leading ".*".
+
+ Also note that the path names may contain forward or backward slashes. Hence
+ you must always use "[/\\]" to be platform independent.
+
+ ======================================================================= -->
+
+
+ <!-- ======================================================================
+ PLATFORM
+ ======================================================================= -->
+
+ <!-- do not check inside the build subdirectory (needed for Netbeans integration) -->
+ <suppress checks=".*" files="[/\\]build[/\\]"/>
+ <!-- do not check inside the test subdirectory (needed for Netbeans integration) -->
+ <suppress checks=".*" files="[/\\]test[/\\]"/>
+ <!--
+ IGNORE 'AvoidInlineConditionals':
+ * inline conditionals basically serve a useful purpose and make simple assignments easier (and shorter) to write
+ * NetBeans even uses conditional assignments in code generated for equals() and hashCode() methods which we
+ do not want to be forced to change manually
+ -->
+ <suppress checks="AvoidInlineConditionals" files=".*"/>
+
+ <!--
+ IGNORE 'IllegalType' for some classes:
+ The parameter classes are generated from the Task service description which contains some abstract
+ type definitions resulting in abstract classes to show up in the method signatures for the generated
+ port type interface
+ -->
+ <suppress checks="IllegalType" files="TaskUtils.java"/>
+ <suppress checks="IllegalType" files="TaskSearchHandler.java"/>
+ <suppress checks="IllegalType" files="FilterFactory.java"/>
+ <suppress checks="IllegalType" files="DefaultFilterFactory.java"/>
+ <suppress checks="IllegalType" files="RecursiveFilter.java"/>
+ <suppress checks="IllegalType" files="PayloadBuilder.java"/>
+</suppressions>
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <appender name="ivy-support-appender" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="datePattern" value="'.'yyyy-MM-dd_HH-mm" />
+ <param name="file" value="logs/Ivy-SupportLogDatei.log" />
+ <param name="Append" value="true" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{ISO8601} %-5p [%t] %c: %m%n" />
+ </layout>
+ </appender>
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="ivy-support-appender" />
+ </root>
+
+</log4j:configuration>
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-shared-configuration>
+ <!--
+This file contains additional configuration written by modules in the NetBeans IDE.
+The configuration is intended to be shared among all the users of project and
+therefore it is assumed to be part of version control checkout.
+Without this configuration present, some functionality in the IDE may be limited or fail altogether.
+-->
+ <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
+ <!--
+Properties that influence various parts of the IDE, especially code formatting and the like.
+You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
+That way multiple projects can share the same settings (useful for formatting rules for example).
+Any value defined here will override the pom.xml file value but is only applicable to the current project.
+-->
+ <netbeans.hint.jdkPlatform>JDK_1.6</netbeans.hint.jdkPlatform>
+ </properties>
+</project-shared-configuration>
231 pom.xml
@@ -0,0 +1,231 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>com.bosch.nexus</groupId>
+ <artifactId>ivy-support</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>nexus-plugin</packaging>
+ <name>TOOLS_NexusExtensions</name>
+ <description>Support for clean up IVY and different snapshot format</description>
+
+ <properties>
+ <nexus-version>2.0.2</nexus-version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+
+ <!-- helpful abstract classes
+ if contributing new kind of Repository,
+ content type, grouping, or any other repository related component -->
+ <dependency>
+ <groupId>org.sonatype.nexus</groupId>
+ <artifactId>nexus-proxy</artifactId>
+ <version>${nexus-version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- logger for tests -->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ <scope>test</scope>
+ <type>jar</type>
+ </dependency>
+
+ <!--to plugin UTs -->
+ <dependency>
+ <groupId>org.sonatype.nexus</groupId>
+ <artifactId>nexus-plugin-test-api</artifactId>
+ <version>${nexus-version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.10</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- utility methods to start/stop Nexus, communicate using REST API, automatically deploy files and more -->
+ <dependency>
+ <groupId>org.sonatype.nexus</groupId>
+ <artifactId>nexus-test-harness-launcher</artifactId>
+ <scope>test</scope>
+ <version>${nexus-version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- matchers are very useful for testing -->
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-core</artifactId>
+ <version>1.3.RC2</version>
+ <scope>test</scope>
+ <type>jar</type>
+ </dependency>
+ </dependencies>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.sonatype.nexus</groupId>
+ <artifactId>nexus-webapp-dependencies</artifactId>
+ <version>${nexus-version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <plugins>
+
+ <!--create a Maven module with packaging “nexus-plugin”-->
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>app-lifecycle-maven-plugin</artifactId>
+ <version>1.6</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>app-lifecycle-nexus</artifactId>
+ <version>1.6</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <!-- compile the sources -->
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
+
+ <!-- toolkit for measuring and reporting Java code coverage -->
+ <plugin>
+ <groupId>org.sonatype.maven.plugin</groupId>
+ <artifactId>emma-maven-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>instrument</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- Fork Tests because of problems with Sisu-Guice-Version -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.9-SONATYPE</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.surefire</groupId>
+ <artifactId>surefire-junit47</artifactId>
+ <version>2.9-SONATYPE</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <!-- Plugin for creating a test instance of Nexus -->
+ <plugin>
+ <groupId>org.sonatype.nexus.plugins</groupId>
+ <artifactId>nexus-test-environment-maven-plugin</artifactId>
+ <version>${nexus-version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>package</goal>
+ <goal>setup-nexus-plugin-environment</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <nexusVersion>${nexus-version}</nexusVersion>
+ <nexusBundleArtifact>
+ <groupId>org.sonatype.nexus</groupId>
+ <artifactId>nexus-oss-webapp</artifactId>
+ <version>2.0.2</version>
+ <classifier>bundle</classifier>
+ <type>zip</type>
+ </nexusBundleArtifact>
+ </configuration>
+ </plugin>
+
+ <!-- Plugin for copy the resources into test instance -->
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.5</version>
+ <executions>
+ <execution>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/target</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${basedir}/src/test/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
+
+ <!--Plugin to execute the integration tests, failsafe reports for example "TestSuite.txt" -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>failsafe-maven-plugin</artifactId>
+ <version>2.4.3-alpha-2-SONATYPE-11146</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+
+ </build>
+
+ <distributionManagement>
+ <repository>
+ <id>tmp_releases</id>
+ <name>Releases Repo on TMP Innovations Waiblingen</name>
+ <url>${url.repo.release}</url>
+ </repository>
+ <snapshotRepository>
+ <id>tmp_snapshots</id>
+ <name>Snapshot Repo on TMP Innovations Waiblingen</name>
+ <url>${url.repo.snapshot}</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+</project>
@@ -0,0 +1,15 @@
+
+package com.bosch.tmp.nexus.ivy.repository;
+
+import org.sonatype.nexus.plugins.RepositoryType;
+import org.sonatype.nexus.proxy.repository.HostedRepository;
+
+/**
+ * Class to register the new TMP-IVY content type for hosted repositories only.
+ *
+ * @author wa20277
+ */
+@RepositoryType(pathPrefix="repositories")
+public interface IVYHostedRepository extends HostedRepository
+{
+}
Oops, something went wrong.

0 comments on commit f4947da

Please sign in to comment.