This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/sling-bundle-archetype.git
commit e2e96781ea14c673335542b8b34f60142a0c517d Author: Robert Munteanu <[email protected]> AuthorDate: Thu May 15 08:36:08 2014 +0000 SLING-3520 - Consolidate archetype plugin versions in a parent pom Update all archetypes to use the archetype parent. Projects missing verification now run a simple verify script which validates that the build was successful and no warnings were generated. git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1594818 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 15 +++------ src/main/resources/archetype-resources/pom.xml | 37 ++++++++++++---------- .../src/main/java/SimpleDSComponent.java | 4 +-- .../resources/projects/normal/archetype.properties | 4 +++ src/test/resources/projects/normal/goal.txt | 1 + src/test/resources/projects/normal/verify.groovy | 9 ++++++ 6 files changed, 40 insertions(+), 30 deletions(-) diff --git a/pom.xml b/pom.xml index f83efa6..3883425 100644 --- a/pom.xml +++ b/pom.xml @@ -21,9 +21,9 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.sling</groupId> - <artifactId>sling</artifactId> - <version>19</version> - <relativePath>../../../parent/pom.xml</relativePath> + <artifactId>sling-archetype-parent</artifactId> + <version>1</version> + <relativePath>../parent/pom.xml</relativePath> </parent> <artifactId>sling-bundle-archetype</artifactId> @@ -44,15 +44,8 @@ <extension> <groupId>org.apache.maven.archetype</groupId> <artifactId>archetype-packaging</artifactId> - <version>2.0-alpha-4</version> + <version>${archetype.version}</version> </extension> </extensions> - <plugins> - <plugin> - <artifactId>maven-archetype-plugin</artifactId> - <version>2.0-alpha-4</version> - <extensions>true</extensions> - </plugin> - </plugins> </build> </project> diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml index d888c03..77a7ff4 100644 --- a/src/main/resources/archetype-resources/pom.xml +++ b/src/main/resources/archetype-resources/pom.xml @@ -19,18 +19,18 @@ --> <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>${groupId}</groupId> - <artifactId>${artifactId}</artifactId> + <groupId>\${groupId}</groupId> + <artifactId>\${artifactId}</artifactId> <packaging>bundle</packaging> - <version>${version}</version> - <name>${artifactId}</name> - <description>${groupId} - ${artifactId}</description> + <version>\${version}</version> + <name>\${artifactId}</name> + <description>\${groupId} - \${artifactId}</description> <build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-scr-plugin</artifactId> - <version>1.13.0</version> + <version>${scrplugin.version}</version> <executions> <execution> <id>generate-scr-descriptor</id> @@ -39,21 +39,21 @@ </goals> </execution> </executions> - <configuration> - <outputDirectory>${project.build.directory}/classes</outputDirectory> - </configuration> </plugin> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> - <version>2.0.1</version> + <version>${bundleplugin.version}</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> - <!-- use version 2.3.2 to have java 1.5 as the default --> - <version>2.3.2</version> + <version>${compilerplugin.version}</version> + <configuration> + <source>${archetype.java.version}</source> + <target>${archetype.java.version}</target> + </configuration> </plugin> </plugins> </build> @@ -85,25 +85,25 @@ <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.api</artifactId> - <version>2.2.0</version> + <version>${slingapi.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> - <version>1.5.10</version> + <version>${slf4japi.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.felix</groupId> <artifactId>org.apache.felix.scr.annotations</artifactId> - <version>1.9.0</version> + <version>${scrannotations.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>3.8.1</version> + <version>${junit.version}</version> <scope>test</scope> </dependency> </dependencies> @@ -115,7 +115,7 @@ <plugin> <groupId>org.apache.sling</groupId> <artifactId>maven-sling-plugin</artifactId> - <version>2.0.4-incubator</version> + <version>${slingplugin.version}</version> <executions> <execution> <id>install-bundle</id> @@ -134,4 +134,7 @@ </build> </profile> </profiles> + <properties> + <project.build.sourceEncoding>${project.build.sourceEncoding}</project.build.sourceEncoding> + </properties> </project> diff --git a/src/main/resources/archetype-resources/src/main/java/SimpleDSComponent.java b/src/main/resources/archetype-resources/src/main/java/SimpleDSComponent.java index 64fe8eb..a3e16bd 100644 --- a/src/main/resources/archetype-resources/src/main/java/SimpleDSComponent.java +++ b/src/main/resources/archetype-resources/src/main/java/SimpleDSComponent.java @@ -33,7 +33,7 @@ import org.slf4j.LoggerFactory; * * @see <a href="https://sling.apache.org/documentation/bundles/scheduler-service-commons-scheduler.html">Scheduler Service</a> */ -@Component(metatype=true) +@Component @Service @Property( name="scheduler.period", longValue = 10) public class SimpleDSComponent implements Runnable { @@ -50,7 +50,7 @@ public class SimpleDSComponent implements Runnable { this.bundleContext = ctx.getBundleContext(); } - protected void deactivate() { + protected void deactivate(ComponentContext ctx) { this.bundleContext = null; } diff --git a/src/test/resources/projects/normal/archetype.properties b/src/test/resources/projects/normal/archetype.properties new file mode 100644 index 0000000..7a24f94 --- /dev/null +++ b/src/test/resources/projects/normal/archetype.properties @@ -0,0 +1,4 @@ +groupId=org.apache.sling +artifactId=test-bundle-archetype-project +version=0.0.1-SNAPSHOT +package=org.apache.sling.archetype.bundle.testing \ No newline at end of file diff --git a/src/test/resources/projects/normal/goal.txt b/src/test/resources/projects/normal/goal.txt new file mode 100644 index 0000000..4a1a71d --- /dev/null +++ b/src/test/resources/projects/normal/goal.txt @@ -0,0 +1 @@ +verify \ No newline at end of file diff --git a/src/test/resources/projects/normal/verify.groovy b/src/test/resources/projects/normal/verify.groovy new file mode 100644 index 0000000..8e4bc97 --- /dev/null +++ b/src/test/resources/projects/normal/verify.groovy @@ -0,0 +1,9 @@ +new File(basedir, '.').eachFileRecurse(groovy.io.FileType.FILES) { logFile -> + if ( logFile.name == "build.log" ) { + logFile.eachLine { line -> + if ( line.contains("WARNING") ) { + throw new RuntimeException("Warning found in line ${line}\nIn file ${logFile}"); + } + } + } +} \ No newline at end of file -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
