You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-commits@incubator.apache.org by lc...@apache.org on 2011/12/29 12:48:06 UTC
svn commit: r1225515 - in /incubator/npanday/trunk: ./ components/
components/dotnet-core/src/main/java/npanday/ components/dotnet-packaging/
components/dotnet-packaging/src/ components/dotnet-packaging/src/main/
components/dotnet-packaging/src/main/ja...
Author: lcorneliussen
Date: Thu Dec 29 12:48:04 2011
New Revision: 1225515
URL: http://svn.apache.org/viewvc?rev=1225515&view=rev
Log:
[NPANDAY-518] Packaging for .NET Applications (Non-Web, also Azure Worker Roles)
o created new plugin an type
o shared component for sharing packaging code between mojos (affected aspnet-maven-plugin)
Added:
incubator/npanday/trunk/components/dotnet-packaging/
incubator/npanday/trunk/components/dotnet-packaging/pom.xml
incubator/npanday/trunk/components/dotnet-packaging/src/
incubator/npanday/trunk/components/dotnet-packaging/src/main/
incubator/npanday/trunk/components/dotnet-packaging/src/main/java/
incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/
incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/
incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/DirectoryPackagePreparer.java
incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/MixinAsssemblyReader.java
- copied, changed from r1224892, incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/MixinAsssemblyReader.java
incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/PackagePreparationConfigurationSource.java
- copied, changed from r1224892, incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/PackagePreparationConfigurationSource.java
incubator/npanday/trunk/components/dotnet-packaging/src/main/resources/
incubator/npanday/trunk/components/dotnet-packaging/src/main/resources/META-INF/
incubator/npanday/trunk/components/dotnet-packaging/src/main/resources/META-INF/plexus/
incubator/npanday/trunk/components/dotnet-packaging/src/main/resources/META-INF/plexus/components.xml
incubator/npanday/trunk/components/dotnet-packaging/src/test/
incubator/npanday/trunk/plugins/application-maven-plugin/
incubator/npanday/trunk/plugins/application-maven-plugin/pom.xml
incubator/npanday/trunk/plugins/application-maven-plugin/src/
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AbstractIteratingMojo.java
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AssemblePackageFilesMojo.java
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PackagePreparedPackageFolders.java
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PreparedPackage.java
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/META-INF/
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/META-INF/plexus/
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/META-INF/plexus/components.xml
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/assemblies/
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/assemblies/application-defaults.xml
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/assemblies/components/
incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/assemblies/components/application-binaries.xml
incubator/npanday/trunk/plugins/application-maven-plugin/src/site/
incubator/npanday/trunk/plugins/application-maven-plugin/src/site/site.xml
Removed:
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/MixinAsssemblyReader.java
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/PackagePreparationConfigurationSource.java
Modified:
incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/ArtifactType.java
incubator/npanday/trunk/components/pom.xml
incubator/npanday/trunk/plugins/aspnet-maven-plugin/pom.xml
incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/AssemblePackageFilesMojo.java
incubator/npanday/trunk/plugins/pom.xml
incubator/npanday/trunk/pom.xml
Modified: incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/ArtifactType.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/ArtifactType.java?rev=1225515&r1=1225514&r2=1225515&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/ArtifactType.java (original)
+++ incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/ArtifactType.java Thu Dec 29 12:48:04 2011
@@ -88,6 +88,12 @@ public enum ArtifactType
*/
DOTNET_ARCHIVE("dotnet-archive", null, "zip"),
+ /**
+ * A zip containing everything an application (or library) needs
+ * to be run, including transitive dependencies and so on.
+ */
+ DOTNET_APPLICATION("dotnet-application", null, "app.zip"),
+
// We should reconsider those..
// DOTNET_ASPX("dotnet-aspx", "library", "dll"),
Added: incubator/npanday/trunk/components/dotnet-packaging/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-packaging/pom.xml?rev=1225515&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-packaging/pom.xml (added)
+++ incubator/npanday/trunk/components/dotnet-packaging/pom.xml Thu Dec 29 12:48:04 2011
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<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">
+ <parent>
+ <groupId>org.apache.npanday</groupId>
+ <version>1.5.0-incubating-SNAPSHOT</version>
+ <artifactId>dotnet-components</artifactId>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>dotnet-packaging</artifactId>
+ <name>NPanday :: Packaging</name>
+ <description>Shared API for packaging .NET applications</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.npanday</groupId>
+ <artifactId>dotnet-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2.1</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/DirectoryPackagePreparer.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/DirectoryPackagePreparer.java?rev=1225515&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/DirectoryPackagePreparer.java (added)
+++ incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/DirectoryPackagePreparer.java Thu Dec 29 12:48:04 2011
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.packaging;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
+import org.apache.maven.plugin.assembly.InvalidAssemblerConfigurationException;
+import org.apache.maven.plugin.assembly.archive.ArchiveCreationException;
+import org.apache.maven.plugin.assembly.archive.AssemblyArchiver;
+import org.apache.maven.plugin.assembly.format.AssemblyFormattingException;
+import org.apache.maven.plugin.assembly.io.AssemblyReadException;
+import org.apache.maven.plugin.assembly.model.Assembly;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+import java.util.List;
+
+/**
+ * Utilizes the Maven Assembly Plugin infrastructure for creating
+ * package folders that can later be used by packaging-components in order to package
+ * the project's contents.
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ *
+ * @plexus.component role="npanday.packaging.DirectoryPackagePreparer"
+ */
+// TODO: split impl and interface?
+public class DirectoryPackagePreparer
+ extends AbstractLogEnabled
+{
+ /**
+ * @plexus.requirement
+ */
+ private AssemblyArchiver assemblyArchiver;
+
+ /**
+ * @plexus.requirement
+ */
+ private MixinAsssemblyReader assemblyReader;
+
+
+ public void preparePackage( AssemblerConfigurationSource configurationSource )
+ throws MojoExecutionException, MojoFailureException
+ {
+ List<Assembly> assemblies;
+ try
+ {
+ assemblies = assemblyReader.readAssemblies( configurationSource );
+ }
+ catch ( final AssemblyReadException e )
+ {
+ throw new MojoExecutionException( "NPANDAY-109-001: Error reading assembly descriptors: " + e.getMessage(),
+ e );
+ }
+ catch ( final InvalidAssemblerConfigurationException e )
+ {
+ throw new MojoFailureException( assemblyReader, e.getMessage(),
+ "NPANDAY-109-002: Mojo configuration is invalid: " + e.getMessage() );
+ }
+
+ if ( assemblies.size() == 0 )
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-109-003: Somehow the assembly reader couldn't find the configured assembly descriptor" );
+ }
+
+ if ( assemblies.size() > 1 )
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-109-004: Somehow the assembly reader provided multiple assembly descriptors, which is not supported by this mojo." );
+ }
+
+ Assembly singleAssembly = assemblies.get( 0 );
+ createDirectory( singleAssembly, configurationSource );
+ }
+
+ private void createDirectory( final Assembly assembly, AssemblerConfigurationSource configurationSource ) throws
+ MojoExecutionException,
+ MojoFailureException
+ {
+
+ final AssemblyArchiver archiver = assemblyArchiver;
+
+ String fullName = configurationSource.getFinalName();
+
+ try
+ {
+ archiver.createArchive( assembly, fullName, "dir", configurationSource );
+ getLogger().info(
+ "NPANDAY-109-009: Prepared package " + fullName + " using assembly " + assembly.getId() + " in '"
+ + configurationSource.getOutputDirectory() + "'."
+ );
+ }
+ catch ( final ArchiveCreationException e )
+ {
+ throw new MojoExecutionException( "NPANDAY-109-005: Error creating package: " + e.getMessage(), e );
+ }
+ catch ( final AssemblyFormattingException e )
+ {
+ throw new MojoExecutionException( "NPANDAY-109-006: Error creating package: " + e.getMessage(), e );
+ }
+ catch ( final InvalidAssemblerConfigurationException e )
+ {
+ throw new MojoFailureException(
+ assembly, "NPANDAY-109-007: Assembly for package is incorrectly configured: " + assembly.getId
+ (),
+ "Assembly: " + assembly.getId() + " is not configured correctly: " + e.getMessage()
+ );
+ }
+ }
+}
Copied: incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/MixinAsssemblyReader.java (from r1224892, incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/MixinAsssemblyReader.java)
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/MixinAsssemblyReader.java?p2=incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/MixinAsssemblyReader.java&p1=incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/MixinAsssemblyReader.java&r1=1224892&r2=1225515&rev=1225515&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/MixinAsssemblyReader.java (original)
+++ incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/MixinAsssemblyReader.java Thu Dec 29 12:48:04 2011
@@ -1,5 +1,3 @@
-package npanday.plugin.aspnet;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -19,18 +17,19 @@ package npanday.plugin.aspnet;
* under the License.
*/
+package npanday.packaging;
+
import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
-import org.apache.maven.plugin.assembly.InvalidAssemblerConfigurationException;
-import org.apache.maven.plugin.assembly.interpolation.AssemblyInterpolator;
import org.apache.maven.plugin.assembly.io.AssemblyReadException;
import org.apache.maven.plugin.assembly.io.DefaultAssemblyReader;
import org.apache.maven.plugin.assembly.model.Assembly;
import java.io.File;
-import java.io.Reader;
/**
* @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ *
+ * @plexus.component role="npanday.packaging.MixinAsssemblyReader"
*/
public class MixinAsssemblyReader extends DefaultAssemblyReader
{
Copied: incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/PackagePreparationConfigurationSource.java (from r1224892, incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/PackagePreparationConfigurationSource.java)
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/PackagePreparationConfigurationSource.java?p2=incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/PackagePreparationConfigurationSource.java&p1=incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/PackagePreparationConfigurationSource.java&r1=1224892&r2=1225515&rev=1225515&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/PackagePreparationConfigurationSource.java (original)
+++ incubator/npanday/trunk/components/dotnet-packaging/src/main/java/npanday/packaging/PackagePreparationConfigurationSource.java Thu Dec 29 12:48:04 2011
@@ -1,5 +1,3 @@
-package npanday.plugin.aspnet;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -19,6 +17,8 @@ package npanday.plugin.aspnet;
* under the License.
*/
+package npanday.packaging;
+
import npanday.PathUtil;
import org.apache.maven.archiver.MavenArchiveConfiguration;
import org.apache.maven.artifact.repository.ArtifactRepository;
Added: incubator/npanday/trunk/components/dotnet-packaging/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-packaging/src/main/resources/META-INF/plexus/components.xml?rev=1225515&view=auto
==============================================================================
--- incubator/npanday/trunk/components/dotnet-packaging/src/main/resources/META-INF/plexus/components.xml (added)
+++ incubator/npanday/trunk/components/dotnet-packaging/src/main/resources/META-INF/plexus/components.xml Thu Dec 29 12:48:04 2011
@@ -0,0 +1,23 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<component-set>
+ <!-- will be generated through annotations -->
+</component-set>
+
Modified: incubator/npanday/trunk/components/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/pom.xml?rev=1225515&r1=1225514&r2=1225515&view=diff
==============================================================================
--- incubator/npanday/trunk/components/pom.xml (original)
+++ incubator/npanday/trunk/components/pom.xml Thu Dec 29 12:48:04 2011
@@ -30,6 +30,7 @@
<artifactId>dotnet-components</artifactId>
<packaging>pom</packaging>
<name>NPanday :: Java Components</name>
+
<modules>
<module>dotnet-artifact</module>
<module>dotnet-assembler</module>
@@ -40,6 +41,7 @@
<module>dotnet-plugin</module>
<module>dotnet-registry</module>
<module>dotnet-vendor</module>
+ <module>dotnet-packaging</module>
</modules>
<dependencies>
<dependency>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/pom.xml?rev=1225515&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/pom.xml (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/pom.xml Thu Dec 29 12:48:04 2011
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<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">
+ <parent>
+ <groupId>org.apache.npanday.plugins</groupId>
+ <version>1.5.0-incubating-SNAPSHOT</version>
+ <artifactId>maven-dotnet-plugins</artifactId>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>application-maven-plugin</artifactId>
+ <packaging>maven-plugin</packaging>
+ <name>NPanday :: Application Maven Plugin</name>
+ <description>Maven Plugin for .NET: Packaging of runnable .NET applications</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-archiver</artifactId>
+ <version>1.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>${plexus.utils.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.npanday</groupId>
+ <artifactId>dotnet-packaging</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/*.iml</exclude>
+
+ <exclude>src/it/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>run-its</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <version>1.5</version>
+ <configuration>
+ <projectsDirectory>src/it</projectsDirectory>
+ <cloneProjectsTo>target/it</cloneProjectsTo>
+ <pomIncludes>
+ <pomInclude>*/pom.xml</pomInclude>
+ </pomIncludes>
+ <!-- Can't use localRepositoryPath or -Dmaven.repo.local with NPanday
+ See https://issues.apache.org/jira/browse/NPANDAY-284
+ <localRepositoryPath>target/local-repo</localRepositoryPath> -->
+ <postBuildHookScript>verify</postBuildHookScript>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>install</goal>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AbstractIteratingMojo.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AbstractIteratingMojo.java?rev=1225515&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AbstractIteratingMojo.java (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AbstractIteratingMojo.java Thu Dec 29 12:48:04 2011
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.application;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+import java.util.List;
+
+/**
+ * Just abstracting the technical part of iterating inside the Mojo.
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public abstract class AbstractIteratingMojo<T>
+ extends AbstractMojo
+{
+ protected void executeItems() throws MojoFailureException, MojoExecutionException
+ {
+ final List<T> iterationItems = prepareIterationItems();
+
+ getLog().info( "NPANDAY-128-003: Configured execution items " + iterationItems );
+
+ for ( T iterationItem : iterationItems )
+ {
+ getLog().info( "NPANDAY-128-004: Executing iteration item " + iterationItem );
+
+ executeItem( iterationItem );
+ }
+ }
+
+ protected abstract void executeItem( T iterationItem ) throws MojoFailureException, MojoExecutionException;
+
+ protected abstract List<T> prepareIterationItems() throws MojoFailureException, MojoExecutionException;
+}
+
+
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AssemblePackageFilesMojo.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AssemblePackageFilesMojo.java?rev=1225515&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AssemblePackageFilesMojo.java (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AssemblePackageFilesMojo.java Thu Dec 29 12:48:04 2011
@@ -0,0 +1,164 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.application;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Splitter;
+import npanday.packaging.DirectoryPackagePreparer;
+import npanday.packaging.MixinAsssemblyReader;
+import npanday.packaging.PackagePreparationConfigurationSource;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.shared.filtering.MavenFileFilter;
+
+import static com.google.common.base.Strings.isNullOrEmpty;
+import static com.google.common.collect.Iterables.toArray;
+
+/**
+ * Maven Mojo preparing the packaging of .NET applications.
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ * @phase prepare-package
+ * @goal assemble-package-files
+ * @since 1.5.0-incubating
+ */
+public class AssemblePackageFilesMojo
+ extends AbstractMojo
+{
+ Splitter COMMANDLINE_LISTS_SPLITTER = Splitter.on( "," ).omitEmptyStrings().trimResults();
+
+ /**
+ * @parameter expression="$(skipPackaging)" default-value="true"
+ */
+ private boolean skip;
+
+ /**
+ * @parameter expression="${assemblyDescriptor}"
+ * @description Assembly XML Descriptor file. This must be the path to your customized descriptor file.
+ * <br><b>assemblyDescriptor will take precedence over {@see assemblyDescriptorRef}</b>
+ */
+ private String assemblyDescriptor;
+
+ /**
+ * @parameter expression="${mixinAssemblyComponentDescriptorList}"
+ * @description Commandline version of {@see mixinAssemblyComponentDescriptors}. Spearate each item with a comma.
+ */
+ private String mixinAssemblyComponentDescriptorList;
+
+ /**
+ * @parameter
+ * @description Component descriptors to be mixed into the main assembly descriptor from
+ * {@see assemblyDescriptorRef} or {@see assemblyDescriptor}.
+ * <br/>This is particularly useful, when the assembly descriptor is provided via the classpath.
+ */
+ private String[] mixinAssemblyComponentDescriptors;
+
+ /**
+ * @parameter expression="${assemblyDescriptorRef}" default-value="application-defaults"
+ * @description A references to an assembly descriptor available on the plugin's classpath. The default
+ * classpath includes these built-in descriptors. You can add others by adding dependencies to the plugin.
+ * <br><b>assemblyDescriptorRef will be ignored, if {@see assemblyDescriptor} is configured</b>
+ */
+ private String assemblyDescriptorRef;
+
+ /**
+ * The Maven Session Object providing both the
+ * current project and the local repository.
+ *
+ * @parameter default-value="${session}"
+ * @required
+ * @readonly
+ */
+ private MavenSession mavenSession;
+
+ /**
+ * @component
+ */
+ private MavenFileFilter fileFilter;
+
+ /**
+ * @component
+ */
+ private MixinAsssemblyReader assemblyReader;
+
+
+ /**
+ * @component
+ */
+ private DirectoryPackagePreparer packagePreparer;
+
+
+ public void execute() throws MojoExecutionException, MojoFailureException
+ {
+ if ( skip )
+ {
+ getLog().info( "NPANDAY-127-000: Application packaging was configured to be skipped" );
+ return;
+ }
+
+ long startTime = System.currentTimeMillis();
+
+ setupParameters();
+
+ final PackagePreparationConfigurationSource packageConfig = new PackagePreparationConfigurationSource(
+ mavenSession, fileFilter
+ );
+
+ if ( !isNullOrEmpty( assemblyDescriptor ) )
+ {
+ packageConfig.setDescriptorFile( assemblyDescriptor );
+ }
+ else if ( !isNullOrEmpty( assemblyDescriptorRef ) )
+ {
+ packageConfig.setDescriptorRef( assemblyDescriptorRef );
+ }
+ else
+ {
+ throw new MojoFailureException(
+ "NPANDAY-127-008: Please configure either assemblyDescriptorRef or assemblyDescriptor"
+ );
+ }
+
+ assemblyReader.setComponentDescriptors(
+ Objects.firstNonNull( mixinAssemblyComponentDescriptors, new String[0] )
+ );
+
+ packagePreparer.preparePackage( packageConfig );
+
+ long endTime = System.currentTimeMillis();
+ getLog().debug( "Mojo Execution Time = " + ( endTime - startTime ) );
+ }
+
+ /**
+ * Copies from commandline parameters to "real" parameters.
+ */
+ private void setupParameters()
+ {
+ if ( !isNullOrEmpty( mixinAssemblyComponentDescriptorList ) )
+ {
+ mixinAssemblyComponentDescriptors = toArray(
+ COMMANDLINE_LISTS_SPLITTER.split( mixinAssemblyComponentDescriptorList ), String.class
+ );
+ }
+ }
+}
+
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PackagePreparedPackageFolders.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PackagePreparedPackageFolders.java?rev=1225515&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PackagePreparedPackageFolders.java (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PackagePreparedPackageFolders.java Thu Dec 29 12:48:04 2011
@@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.application;
+
+import com.google.common.collect.Lists;
+import npanday.ArtifactType;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectHelper;
+import org.codehaus.plexus.archiver.ArchiverException;
+import org.codehaus.plexus.archiver.zip.ZipArchiver;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ * @phase package
+ * @goal package
+ * @since 1.5.0-incubating
+ */
+public class PackagePreparedPackageFolders
+ extends AbstractIteratingMojo<PreparedPackage>
+{
+
+ /**
+ * The maven project.
+ *
+ * @parameter expression="${project}"
+ * @required
+ */
+ protected MavenProject project;
+
+ /**
+ * The maven project helper.
+ *
+ * @component
+ */
+ protected MavenProjectHelper projectHelper;
+
+ /**
+ * The Zip archiver.
+ *
+ * @parameter expression="${component.org.codehaus.plexus.archiver.Archiver#zip}"
+ * @required
+ */
+ private ZipArchiver archiver;
+
+ /**
+ * The directory for the created zip
+ *
+ * @parameter expression = "${outputDirectory}" default-value = "${project.build.directory}"
+ */
+ private File outputDirectory;
+
+
+ public void execute() throws MojoExecutionException, MojoFailureException
+ {
+ executeItems();
+ }
+
+ @Override
+ protected List<PreparedPackage> prepareIterationItems() throws MojoFailureException, MojoExecutionException
+ {
+ List<PreparedPackage> list = Lists.newArrayList();
+
+ // TODO: Support multiple packages with different classifiers
+ final PreparedPackage pkg = new PreparedPackage( project );
+
+ if ( pkg.exists() )
+ {
+ getLog().debug( "NPANDAY-130-000: Found a prepared package: " + pkg );
+ list.add( pkg );
+ }
+ else
+ {
+ getLog().debug( "NPANDAY-130-000: Did not find a prepared package!" );
+ }
+
+ return list;
+ }
+
+ @Override
+ protected void executeItem( PreparedPackage iterationItem ) throws MojoFailureException, MojoExecutionException
+ {
+ File destinationFile = new File(
+ outputDirectory, project.getArtifactId() + "." + ArtifactType.DOTNET_APPLICATION.getExtension()
+ );
+ archiver.setDestFile( destinationFile );
+
+ getLog().info( "NPANDAY-130-001: Generating package from " + destinationFile.getAbsolutePath() );
+
+ try
+ {
+ archiver.addDirectory( iterationItem.getPackageFolder() );
+ }
+ catch ( ArchiverException e )
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-130-002: Unable to package prepared package from "
+ + iterationItem.getPackageFolder().getAbsolutePath(), e
+ );
+ }
+
+ // create archive
+ try
+ {
+ archiver.createArchive();
+ }
+ catch ( ArchiverException e )
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-130-003: Unable to package prepared package in " + destinationFile.getAbsolutePath(), e
+ );
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-130-004: Unable to package prepared package in " + destinationFile.getAbsolutePath(), e
+ );
+ }
+
+ projectHelper.attachArtifact( project, ArtifactType.DOTNET_APPLICATION.getPackagingType(), destinationFile );
+ }
+}
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PreparedPackage.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PreparedPackage.java?rev=1225515&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PreparedPackage.java (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PreparedPackage.java Thu Dec 29 12:48:04 2011
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.application;
+
+import npanday.PathUtil;
+import org.apache.maven.project.MavenProject;
+
+import java.io.File;
+
+/**
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public class PreparedPackage
+{
+ private File packageFolder;
+
+ public PreparedPackage( MavenProject project )
+ {
+ this.packageFolder = PathUtil.getPreparedPackageFolder( project );
+ }
+
+ public boolean exists(){
+ return packageFolder.exists();
+ }
+
+ public File getPackageFolder()
+ {
+ return packageFolder;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "PreparedPackage{no classifier, " + "packageFolder=" + packageFolder + '}';
+ }
+}
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/META-INF/plexus/components.xml?rev=1225515&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/META-INF/plexus/components.xml (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/META-INF/plexus/components.xml Thu Dec 29 12:48:04 2011
@@ -0,0 +1,26 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<component-set>
+ <components>
+ <component>
+ <role>npanday.plugin.aspnet.MixinAsssemblyReader</role>
+ <implementation>npanday.plugin.aspnet.MixinAsssemblyReader</implementation>
+ </component>
+ </components>
+</component-set>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/assemblies/application-defaults.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/assemblies/application-defaults.xml?rev=1225515&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/assemblies/application-defaults.xml (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/assemblies/application-defaults.xml Thu Dec 29 12:48:04 2011
@@ -0,0 +1,36 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>application-defaults</id>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <formats>
+ <format>dir</format>
+ </formats>
+
+ <componentDescriptors>
+ <!--
+ Just specifying bare file names would need a fix for:
+ http://jira.codehaus.org/browse/MASSEMBLY-585
+ -->
+ <componentDescriptor>/assemblies/components/application-binaries.xml</componentDescriptor>
+ </componentDescriptors>
+</assembly>
\ No newline at end of file
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/assemblies/components/application-binaries.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/assemblies/components/application-binaries.xml?rev=1225515&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/assemblies/components/application-binaries.xml (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/main/resources/assemblies/components/application-binaries.xml Thu Dec 29 12:48:04 2011
@@ -0,0 +1,31 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<component xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2 http://maven.apache.org/xsd/component-1.1.2.xsd">
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <useTransitiveDependencies>true</useTransitiveDependencies>
+ <scope>runtime</scope>
+ <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
+ <outputDirectory></outputDirectory>
+ </dependencySet>
+ </dependencySets>
+</component>
\ No newline at end of file
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/site/site.xml?rev=1225515&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/site/site.xml (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/site/site.xml Thu Dec 29 12:48:04 2011
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<project xmlns="http://maven.apache.org/DECORATION/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
+ <body>
+ <menu ref="parent" />
+
+ <menu name="Overview">
+ <item name="About" href="index.html"/>
+ <item name="Goals" href="plugin-info.html"/>
+ </menu>
+
+ <menu ref="reports" />
+ </body>
+</project>
Modified: incubator/npanday/trunk/plugins/aspnet-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/pom.xml?rev=1225515&r1=1225514&r2=1225515&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/pom.xml (original)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/pom.xml Thu Dec 29 12:48:04 2011
@@ -51,6 +51,10 @@
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.npanday</groupId>
+ <artifactId>dotnet-packaging</artifactId>
+ </dependency>
</dependencies>
<build>
Modified: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/AssemblePackageFilesMojo.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/AssemblePackageFilesMojo.java?rev=1225515&r1=1225514&r2=1225515&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/AssemblePackageFilesMojo.java (original)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/AssemblePackageFilesMojo.java Thu Dec 29 12:48:04 2011
@@ -21,32 +21,25 @@ package npanday.plugin.aspnet;
import com.google.common.base.Objects;
import com.google.common.base.Splitter;
-import com.google.common.collect.Iterables;
+import npanday.packaging.DirectoryPackagePreparer;
+import npanday.packaging.MixinAsssemblyReader;
+import npanday.packaging.PackagePreparationConfigurationSource;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
-import org.apache.maven.plugin.assembly.InvalidAssemblerConfigurationException;
-import org.apache.maven.plugin.assembly.archive.ArchiveCreationException;
-import org.apache.maven.plugin.assembly.archive.AssemblyArchiver;
-import org.apache.maven.plugin.assembly.format.AssemblyFormattingException;
-import org.apache.maven.plugin.assembly.io.AssemblyReadException;
-import org.apache.maven.plugin.assembly.io.AssemblyReader;
-import org.apache.maven.plugin.assembly.model.Assembly;
import org.apache.maven.shared.filtering.MavenFileFilter;
-import java.util.List;
-
-import static com.google.common.base.Strings.*;
+import static com.google.common.base.Strings.isNullOrEmpty;
import static com.google.common.collect.Iterables.toArray;
/**
* Maven Mojo preparing the packaging of ASP.NET web applications.
*
* @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ *
+ * @phase prepare-package
* @goal assemble-package-files
- * @description Maven Mojo for preparing the packaging of ASP.NET web applications
* @since 1.5.0-incubating
*/
public class AssemblePackageFilesMojo
@@ -96,17 +89,18 @@ public class AssemblePackageFilesMojo
/**
* @component
*/
- private MixinAsssemblyReader assemblyReader;
+ private MavenFileFilter fileFilter;
/**
* @component
*/
- private AssemblyArchiver assemblyArchiver;
+ private MixinAsssemblyReader assemblyReader;
- /**
+
+/**
* @component
*/
- private MavenFileFilter fileFilter;
+ private DirectoryPackagePreparer packagePreparer;
public void execute()
@@ -134,7 +128,7 @@ public class AssemblePackageFilesMojo
assemblyReader.setComponentDescriptors( Objects.firstNonNull( mixinAssemblyComponentDescriptors, new String[0] ));
- createPackage( packageConfig );
+ packagePreparer.preparePackage( packageConfig );
long endTime = System.currentTimeMillis();
getLog().debug( "Mojo Execution Time = " + ( endTime - startTime ) );
@@ -151,71 +145,5 @@ public class AssemblePackageFilesMojo
toArray( COMMANDLINE_LISTS_SPLITTER.split( mixinAssemblyComponentDescriptorList ), String.class );
}
}
+}
- public void createPackage( AssemblerConfigurationSource configurationSource )
- throws MojoExecutionException, MojoFailureException
- {
- List<Assembly> assemblies;
- try
- {
- assemblies = assemblyReader.readAssemblies( configurationSource );
- }
- catch ( final AssemblyReadException e )
- {
- throw new MojoExecutionException( "NPANDAY-109-001: Error reading assembly descriptors: " + e.getMessage(),
- e );
- }
- catch ( final InvalidAssemblerConfigurationException e )
- {
- throw new MojoFailureException( assemblyReader, e.getMessage(),
- "NPANDAY-109-002: Mojo configuration is invalid: " + e.getMessage() );
- }
-
- if ( assemblies.size() == 0 )
- {
- throw new MojoExecutionException(
- "NPANDAY-109-003: Somehow the assembly reader couldn't find the configured assembly descriptor" );
- }
-
- if ( assemblies.size() > 1 )
- {
- throw new MojoExecutionException(
- "NPANDAY-109-004: Somehow the assembly reader provided multiple assembly descriptors, which is not supported by this mojo." );
- }
-
- Assembly singleAssembly = assemblies.get( 0 );
- createDirectory( singleAssembly, configurationSource );
- }
-
- private void createDirectory( final Assembly assembly, AssemblerConfigurationSource configurationSource )
- throws MojoExecutionException, MojoFailureException
- {
- final AssemblyArchiver archiver = assemblyArchiver;
-
- String fullName = configurationSource.getFinalName();
-
- try
- {
- archiver.createArchive( assembly, fullName, "dir", configurationSource );
- getLog().info(
- "NPANDAY-109-009: Prepared package " + fullName + " using assembly " + assembly.getId() + " in '"
- + configurationSource.getOutputDirectory() + "'." );
- }
- catch ( final ArchiveCreationException e )
- {
- throw new MojoExecutionException( "NPANDAY-109-005: Error creating aspnet package: " + e.getMessage(), e );
- }
- catch ( final AssemblyFormattingException e )
- {
- throw new MojoExecutionException( "NPANDAY-109-006: Error creating aspnet package: " + e.getMessage(), e );
- }
- catch ( final InvalidAssemblerConfigurationException e )
- {
- throw new MojoFailureException( assembly,
- "NPANDAY-109-007: Assembly for aspnet package is incorrectly configured: "
- + assembly.getId(),
- "Assembly: " + assembly.getId() + " is not configured correctly: "
- + e.getMessage() );
- }
- }
-}
\ No newline at end of file
Modified: incubator/npanday/trunk/plugins/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/pom.xml?rev=1225515&r1=1225514&r2=1225515&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/pom.xml (original)
+++ incubator/npanday/trunk/plugins/pom.xml Thu Dec 29 12:48:04 2011
@@ -58,6 +58,7 @@
<module>partcover-maven-plugin</module>
<module>msdeploy-maven-plugin</module>
<module>azure-maven-plugin</module>
+ <module>application-maven-plugin</module>
</modules>
<dependencies>
<dependency>
Modified: incubator/npanday/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/pom.xml?rev=1225515&r1=1225514&r2=1225515&view=diff
==============================================================================
--- incubator/npanday/trunk/pom.xml (original)
+++ incubator/npanday/trunk/pom.xml Thu Dec 29 12:48:04 2011
@@ -463,7 +463,12 @@ under the License.
<groupId>org.apache.npanday</groupId>
<artifactId>dotnet-model-settings</artifactId>
<version>1.5.0-incubating-SNAPSHOT</version>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.npanday</groupId>
+ <artifactId>dotnet-packaging</artifactId>
+ <version>1.5.0-incubating-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.maven</groupId>