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 2012/01/16 21:47:33 UTC
svn commit: r1232177 [2/2] - in /incubator/npanday/trunk: ./ components/
components/dotnet-core/src/main/java/npanday/
components/dotnet-executable/src/main/java/npanday/executable/
components/dotnet-executable/src/main/java/npanday/executable/impl/ co...
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/goals.txt
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/goals.txt?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/goals.txt (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/goals.txt Mon Jan 16 21:47:30 2012
@@ -0,0 +1 @@
+clean prepare-package
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/pom.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/pom.xml (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/pom.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,52 @@
+<?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:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>@project.groupId@.@project.artifactId@-its</groupId>
+ <artifactId>IT003_CopyAppConfig</artifactId>
+ <version>@project.version@</version>
+ <packaging>pom</packaging>
+
+ <properties>
+ <frameworkVersion>4.0</frameworkVersion>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>@project.groupId@</groupId>
+ <artifactId>@project.artifactId@</artifactId>
+ <version>@project.version@</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>process-configs</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/verify.groovy
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/verify.groovy?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/verify.groovy (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT003_CopyAppConfig/verify.groovy Mon Jan 16 21:47:30 2012
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+
+
+
+def packageDir = new File(basedir, "target\\packages\\IT003_CopyAppConfig")
+assert packageDir.exists()
+
+// is null.config, because it is neither dll or exe, but pom
+def configFile = new File(packageDir, "IT003_CopyAppConfig.null.config")
+assert configFile.exists();
+
+def xml = new XmlSlurper().parse(configFile)
+assert xml.connectionStrings[0].add[0].@connectionString == "original"
+
+return true;
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/config.otherhint.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/config.otherhint.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/config.otherhint.xml (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/config.otherhint.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ 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.
+ -->
+
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+ <connectionStrings>
+ <add name="name"
+ connectionString="from-otherhint-transform"
+
+ xdt:Transform="Replace"
+ xdt:Locator="Match(name)"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/config.package.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/config.package.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/config.package.xml (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/config.package.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ 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.
+ -->
+
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+ <connectionStrings>
+ <add name="name"
+ connectionString="from-package-transform"
+
+ xdt:Transform="Replace"
+ xdt:Locator="Match(name)"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/config.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/config.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/config.xml (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/config.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ 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.
+ -->
+
+<configuration>
+ <connectionStrings>
+ <add name="name" connectionString="original"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/excluded.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/excluded.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/excluded.xml (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/excluded.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ 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.
+ -->
+
+<configuration>
+ <connectionStrings>
+ <add name="name" connectionString="original"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/goals.txt
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/goals.txt?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/goals.txt (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/goals.txt Mon Jan 16 21:47:30 2012
@@ -0,0 +1 @@
+clean prepare-package
\ No newline at end of file
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/pom.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/pom.xml (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/pom.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,60 @@
+<?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:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>@project.groupId@.@project.artifactId@-its</groupId>
+ <artifactId>IT004_CopyTransformOtherXmlFiles</artifactId>
+ <version>@project.version@</version>
+ <packaging>pom</packaging>
+
+ <properties>
+ <frameworkVersion>4.0</frameworkVersion>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>@project.groupId@</groupId>
+ <artifactId>@project.artifactId@</artifactId>
+ <version>@project.version@</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>process-configs</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <additionalConfigIncludes>
+ <additionalConfigInclude>*.xml</additionalConfigInclude>
+ </additionalConfigIncludes>
+ <additionalConfigExcludes>
+ <additionalConfigExclude>excluded.xml</additionalConfigExclude>
+ </additionalConfigExcludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Added: incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/verify.groovy
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/verify.groovy?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/verify.groovy (added)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/it/IT004_CopyTransformOtherXmlFiles/verify.groovy Mon Jan 16 21:47:30 2012
@@ -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.
+ */
+
+def packageDir = new File(basedir, "target\\packages\\IT004_CopyTransformOtherXmlFiles")
+assert packageDir.exists()
+
+// is null.config, because it is neither dll or exe, but pom
+// repeating "config.xml" for better assertion error message
+assert new File(packageDir, "config.xml").exists()
+
+def xml = new XmlSlurper().parse(new File(packageDir, "config.xml"))
+assert xml.connectionStrings[0].add[0].@connectionString == "from-package-transform"
+
+assert new File(packageDir, "config.package.xml").exists() == false
+assert new File(packageDir, "config.otherhint.xml").exists() == false
+assert new File(packageDir, "excluded.xml").exists() == false
+assert new File(packageDir, "pom.xml").exists() == false
+
+
+return true;
Copied: incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AbstractNPandayMojo.java (from r1230518, incubator/npanday/trunk/plugins/azure-maven-plugin/src/main/java/npanday/plugin/azure/AbstractNPandayMojo.java)
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AbstractNPandayMojo.java?p2=incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AbstractNPandayMojo.java&p1=incubator/npanday/trunk/plugins/azure-maven-plugin/src/main/java/npanday/plugin/azure/AbstractNPandayMojo.java&r1=1230518&r2=1232177&rev=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/azure-maven-plugin/src/main/java/npanday/plugin/azure/AbstractNPandayMojo.java (original)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AbstractNPandayMojo.java Mon Jan 16 21:47:30 2012
@@ -17,20 +17,25 @@
* under the License.
*/
-package npanday.plugin.azure;
+package npanday.plugin.application;
+import com.google.common.base.Splitter;
import org.apache.maven.plugin.AbstractMojo;
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 static com.google.common.collect.Iterables.toArray;
+
/**
* @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
*/
public abstract class AbstractNPandayMojo
extends AbstractMojo
{
+ public Splitter SPLIT_ON_SEMICOLON = Splitter.on( ';' ).omitEmptyStrings().trimResults();
+
/**
* If the execution of this goal is to be skipped.
*
@@ -53,14 +58,46 @@ public abstract class AbstractNPandayMoj
*/
protected MavenProjectHelper projectHelper;
- public void execute() throws MojoExecutionException, MojoFailureException
+ public final void execute() throws MojoExecutionException, MojoFailureException
{
- if ( skip )
+ if ( skip )
{
getLog().info(
"NPANDAY-126-000: Execution of '" + getClass().getSimpleName() + "' was skipped by configuration."
);
return;
}
+
+ setupParameters();
+
+ innerExecute();
+ }
+
+ protected void setupParameters()
+ {
+
+ }
+
+ protected String[] firstNonNull( String commandlineValues, String[] configurationValues )
+ {
+ return firstNonNull( commandlineValues, configurationValues, new String[0] );
}
+
+ protected String[] firstNonNull( String commandlineValues, String[] configurationValues, String[] defaultValue )
+ {
+ if ( commandlineValues != null )
+ {
+ return toArray(
+ SPLIT_ON_SEMICOLON.split( commandlineValues ), String.class
+ );
+ }
+
+ if (configurationValues != null){
+ return configurationValues;
+ }
+
+ return defaultValue;
+ }
+
+ protected abstract void innerExecute() throws MojoExecutionException, MojoFailureException;
}
Copied: incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AbstractNPandaySettingsAwareMojo.java (from r1230518, incubator/npanday/trunk/plugins/azure-maven-plugin/src/main/java/npanday/plugin/azure/AbstractNPandaySettingsAwareMojo.java)
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AbstractNPandaySettingsAwareMojo.java?p2=incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AbstractNPandaySettingsAwareMojo.java&p1=incubator/npanday/trunk/plugins/azure-maven-plugin/src/main/java/npanday/plugin/azure/AbstractNPandaySettingsAwareMojo.java&r1=1230518&r2=1232177&rev=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/azure-maven-plugin/src/main/java/npanday/plugin/azure/AbstractNPandaySettingsAwareMojo.java (original)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AbstractNPandaySettingsAwareMojo.java Mon Jan 16 21:47:30 2012
@@ -17,10 +17,11 @@
* under the License.
*/
-package npanday.plugin.azure;
+package npanday.plugin.application;
import npanday.registry.RepositoryRegistry;
import npanday.vendor.SettingsUtil;
+import npanday.vendor.VendorRequirement;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
@@ -68,10 +69,12 @@ public abstract class AbstractNPandaySet
protected npanday.executable.NetExecutableFactory netExecutableFactory;
@Override
- public void execute() throws MojoExecutionException, MojoFailureException
+ protected void innerExecute() throws MojoExecutionException, MojoFailureException
{
- super.execute();
-
SettingsUtil.applyCustomSettings( getLog(), repositoryRegistry, settingsPath );
}
+
+ protected VendorRequirement getVendorRequirement(){
+ return new VendorRequirement( vendor, vendorVersion, frameworkVersion);
+ }
}
Modified: 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=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AssemblePackageFilesMojo.java (original)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/AssemblePackageFilesMojo.java Mon Jan 16 21:47:30 2012
@@ -44,7 +44,7 @@ import static com.google.common.collect.
public class AssemblePackageFilesMojo
extends AbstractMojo
{
- Splitter COMMANDLINE_LISTS_SPLITTER = Splitter.on( "," ).omitEmptyStrings().trimResults();
+ Splitter COMMANDLINE_LISTS_SPLITTER = Splitter.on( ";" ).omitEmptyStrings().trimResults();
/**
* Specifies if the goal should be skipped.
@@ -62,7 +62,7 @@ public class AssemblePackageFilesMojo
private String assemblyDescriptor;
/**
- * Commandline version of {@see mixinAssemblyComponentDescriptors}. Spearate each item with a comma.
+ * Commandline version of {@see mixinAssemblyComponentDescriptors}. Spearate each item with a semicolon.
*
* @parameter expression="${mixinAssemblyComponentDescriptorList}"
*/
Copied: incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PackagePreparedPackageFoldersMojo.java (from r1231089, 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/PackagePreparedPackageFoldersMojo.java?p2=incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PackagePreparedPackageFoldersMojo.java&p1=incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PackagePreparedPackageFolders.java&r1=1231089&r2=1232177&rev=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PackagePreparedPackageFolders.java (original)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/PackagePreparedPackageFoldersMojo.java Mon Jan 16 21:47:30 2012
@@ -38,11 +38,11 @@ import java.util.List;
*
* @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
* @phase package
- * @goal package
+ * @goal create-package
*
* @since 1.5.0-incubating
*/
-public class PackagePreparedPackageFolders
+public class PackagePreparedPackageFoldersMojo
extends AbstractIteratingMojo<PreparedPackage>
{
@@ -64,7 +64,7 @@ public class PackagePreparedPackageFolde
/**
* The Zip archiver.
*
- * @parameter expression="${component.org.codehaus.plexus.archiver.Archiver#zip}"
+ * @parameter role="component.org.codehaus.plexus.archiver.Archiver" role-hint="zip"
* @required
*/
private ZipArchiver archiver;
Copied: incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/ProcessAppConfigsMojo.java (from r1231089, incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/ProcessAppConfigMojo.java)
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/ProcessAppConfigsMojo.java?p2=incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/ProcessAppConfigsMojo.java&p1=incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/ProcessAppConfigMojo.java&r1=1231089&r2=1232177&rev=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/ProcessAppConfigMojo.java (original)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/main/java/npanday/plugin/application/ProcessAppConfigsMojo.java Mon Jan 16 21:47:30 2012
@@ -19,37 +19,96 @@
package npanday.plugin.application;
+import com.google.common.collect.Lists;
import npanday.ArtifactType;
import npanday.PathUtil;
import npanday.packaging.ConfigFileHandler;
-import org.apache.maven.plugin.AbstractMojo;
+import npanday.vendor.VendorRequirement;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
import java.io.File;
+import java.util.List;
/**
- * TODO: document, when config handling is figured out
+ * Finds, transforms and copies arbitrary configuration files for packaging.
*
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
*
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
* @phase prepare-package
- * @goal process-app-config
+ * @goal process-configs
* @since 1.5.0-incubating
*/
-public class ProcessAppConfigMojo
- extends AbstractMojo
+public class ProcessAppConfigsMojo
+ extends AbstractNPandaySettingsAwareMojo
{
/**
- * @parameter default-value="false"
+ * The main configuration file (relative to the basedir)
+ * to be packaged along with the application.
+ *
+ * This one will be added to {@see #additionalConfigExcludes}
+ * in order to avoid duplicate handling.
+ *
+ * @parameter default-value="app.config"
+ */
+ private String appConfigFile;
+
+ /**
+ * The transformation to apply to the configurations
+ * specified in {@link #appConfigFile} and {@link #additionalConfigIncludes}.
+ *
+ * The Mojo will search for transformations by 'injecting' the
+ * configured hint between a file name and its extension:
+ * <code><file-name>.<transformation-hint>.<file-extension></code>.
+ *
+ * @parameter default-value="package"
+ */
+ private String transformationHint;
+
+ /**
+ * Expressions for config files to additionally include further configuration files that
+ * need to be copied and/or transformed.
+ *
+ * Defaults to <code>*.config</code>, if not overridden by {@see additionalConfigIncludesList}.
+ *
+ * Transformations are automatically excluded from being processed as main configs,
+ * while a transformation is detected as such, if it follows the format described in {@see #transformationHint}
+ * and a potential target file (without the hint) exists.
+ *
+ * @parameter
*/
- private boolean skip;
+ private String[] additionalConfigIncludes;
/**
- * @parameter default-value="${basedir}/app.package.config"
+ * Expressions for config files to explicitely exclude from config processing.
+ *
+ * <code>pom.xml</code> will always be excluded by default.
+ *
+ * @parameter
*/
- private File appConfig;
+ private String[] additionalConfigExcludes;
+
+ /**
+ * Semicolon-separated command line version of {@link #additionalConfigIncludes}
+ *
+ * @parameter expression="${config.includes}"
+ */
+ private String additionalConfigIncludesList;
+
+ /**
+ * Semicolon-separated command line version of {@link #additionalConfigExcludes}
+ *
+ * @parameter expression="${config.excludes}"
+ */
+ private String additionalConfigExcludesList;
+
+ /**
+ * Place to store temporary files for the transformation process.
+ *
+ * @parameter default-value="${project.build.directory}/xdt"
+ */
+ private File workingFolder;
/**
* The maven project.
@@ -62,25 +121,48 @@ public class ProcessAppConfigMojo
/**
* @component
*/
- protected ConfigFileHandler confiFileHandler;
+ protected ConfigFileHandler configFileHandler;
- public void execute() throws MojoExecutionException, MojoFailureException
+ @Override
+ protected void setupParameters()
{
- if ( skip )
- {
- getLog().info( "NPANDAY-132-000: Automatic handling of app.config was skipped by configuration" );
- return;
- }
+ additionalConfigIncludes = firstNonNull(
+ additionalConfigIncludesList, additionalConfigIncludes, new String[]{ "*.config" }
+ );
+ additionalConfigExcludes = firstNonNull( additionalConfigExcludesList, additionalConfigExcludes );
+ }
- final File sourceConfigFile = appConfig;
+ @Override
+ public void innerExecute() throws MojoExecutionException, MojoFailureException
+ {
+ super.innerExecute();
+
+ final List<String> excludes = Lists.newArrayList( additionalConfigExcludes );
+ excludes.add( appConfigFile );
+
+ final String[] includes = additionalConfigIncludes;
+ final File targetFolder = PathUtil.getPreparedPackageFolder( project );
+
+ configFileHandler.setWorkingFolder( workingFolder );
String extension = ArtifactType.getArtifactTypeForPackagingName( project.getPackaging() ).getExtension();
File targetConfigFile = new File(
- PathUtil.getPreparedPackageFolder( project ), project.getArtifactId() + "." + extension + ".config"
+ targetFolder, project.getArtifactId() + "." + extension + ".config"
);
- confiFileHandler.handleConfigFile( sourceConfigFile, targetConfigFile );
- }
+ final VendorRequirement vendorRequirement = getVendorRequirement();
+ configFileHandler.handleConfigFile(
+ vendorRequirement, new File( project.getBasedir(), appConfigFile ), transformationHint, targetConfigFile
+ );
+
+ if ( includes.length > 0 )
+ {
+ configFileHandler.handleConfigFiles(
+ vendorRequirement, project.getBasedir(), includes, excludes.toArray( new String[0] ),
+ transformationHint, targetFolder
+ );
+ }
+ }
}
Modified: incubator/npanday/trunk/plugins/application-maven-plugin/src/site/apt/usage.apt.vm
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/application-maven-plugin/src/site/apt/usage.apt.vm?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/application-maven-plugin/src/site/apt/usage.apt.vm (original)
+++ incubator/npanday/trunk/plugins/application-maven-plugin/src/site/apt/usage.apt.vm Mon Jan 16 21:47:30 2012
@@ -32,7 +32,7 @@ Using the NPanday Application Maven Plug
<execution>
<goals>
<goal>assemble-package-files</goal>
- <goal>process-app-config</goal>
+ <goal>process-configs</goal>
<goal>package</goal>
</goals>
</execution>
@@ -40,6 +40,8 @@ Using the NPanday Application Maven Plug
</plugin>
+---+
- Read more about how to control which files to include and not to include here:
+ Read more about configuration transformations and how to control
+ which file includes/excludes here in the
{{{../../guide/advanced/application-packaging.html}.NET Application Packaging}}
+ section.
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=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/pom.xml (original)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/pom.xml Mon Jan 16 21:47:30 2012
@@ -67,38 +67,4 @@
</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/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/connectionStrings.config
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/connectionStrings.config?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/connectionStrings.config (added)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/connectionStrings.config Mon Jan 16 21:47:30 2012
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ 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.
+ -->
+
+<configuration>
+ <connectionStrings>
+ <add name="name" connectionString="original"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/connectionStrings.package.config
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/connectionStrings.package.config?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/connectionStrings.package.config (added)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/connectionStrings.package.config Mon Jan 16 21:47:30 2012
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ 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.
+ -->
+
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+ <connectionStrings>
+ <add name="name"
+ connectionString="from-package-transform"
+
+ xdt:Transform="Replace"
+ xdt:Locator="Match(name)"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/config.otherhint.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/config.otherhint.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/config.otherhint.xml (added)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/config.otherhint.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ 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.
+ -->
+
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+ <connectionStrings>
+ <add name="name"
+ connectionString="from-otherhint-transform"
+
+ xdt:Transform="Replace"
+ xdt:Locator="Match(name)"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/config.package.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/config.package.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/config.package.xml (added)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/config.package.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ 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.
+ -->
+
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+ <connectionStrings>
+ <add name="name"
+ connectionString="from-package-transform"
+
+ xdt:Transform="Replace"
+ xdt:Locator="Match(name)"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/config.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/config.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/config.xml (added)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/config.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ 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.
+ -->
+
+<configuration>
+ <connectionStrings>
+ <add name="name" connectionString="original"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/excluded.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/excluded.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/excluded.xml (added)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/different_extension/excluded.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ 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.
+ -->
+
+<configuration>
+ <connectionStrings>
+ <add name="name" connectionString="original"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/goals.txt
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/goals.txt?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/goals.txt (added)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/goals.txt Mon Jan 16 21:47:30 2012
@@ -0,0 +1 @@
+clean prepare-package
Added: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/pom.xml?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/pom.xml (added)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/pom.xml Mon Jan 16 21:47:30 2012
@@ -0,0 +1,59 @@
+<?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:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>@project.groupId@.@project.artifactId@-its</groupId>
+ <artifactId>IT003_AdditionalComponents</artifactId>
+ <version>@project.version@</version>
+ <packaging>pom</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>@project.groupId@</groupId>
+ <artifactId>@project.artifactId@</artifactId>
+ <version>@project.version@</version>
+ <extensions>true</extensions>
+ <executions>
+ <execution>
+ <id>default-package</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>process-configs</goal>
+ </goals>
+ <configuration>
+ <frameworkVersion>4.0</frameworkVersion>
+ <configIncludes>
+ <configInclude>**/*.config</configInclude>
+ <configInclude>**/*.xml</configInclude>
+ </configIncludes>
+ <configExcludes>
+ <configExclude>**/excluded.xml</configExclude>
+ </configExcludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Added: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/sublevel/web.config
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/sublevel/web.config?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/sublevel/web.config (added)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/sublevel/web.config Mon Jan 16 21:47:30 2012
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ 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.
+ -->
+<configuration>
+ <connectionStrings>
+ <add name="name" connectionString="original"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/sublevel/web.package.config
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/sublevel/web.package.config?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/sublevel/web.package.config (added)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/sublevel/web.package.config Mon Jan 16 21:47:30 2012
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!--
+ ~ 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.
+ -->
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+ <connectionStrings>
+ <add name="name"
+ connectionString="from-package-transform"
+
+ xdt:Transform="Replace"
+ xdt:Locator="Match(name)"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/verify.groovy
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/verify.groovy?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/verify.groovy (added)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/verify.groovy Mon Jan 16 21:47:30 2012
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+
+def packageDir = new File(basedir, "target\\packages\\IT003_AdditionalComponents")
+assert packageDir.exists()
+
+assert new File(packageDir, "web.config").exists()
+def xml = new XmlSlurper().parse(new File(packageDir, "web.config"))
+assert xml.connectionStrings[0].add[0].@connectionString == "from-package-transform"
+
+assert new File(packageDir, "web.package.config").exists() == false
+
+assert new File(packageDir, "connectionStrings.config").exists()
+xml = new XmlSlurper().parse(new File(packageDir, "connectionStrings.config"))
+assert xml.connectionStrings[0].add[0].@connectionString == "from-package-transform"
+
+assert new File(packageDir, "connectionStrings.package.config").exists() == false
+
+assert new File(packageDir, "sublevel/web.config").exists()
+xml = new XmlSlurper().parse(new File(packageDir, "sublevel/web.config"))
+assert xml.connectionStrings[0].add[0].@connectionString == "from-package-transform"
+
+assert new File(packageDir, "sublevel/web.package.config").exists() == false
+
+assert new File(packageDir, "different_extension/config.xml").exists()
+xml = new XmlSlurper().parse(new File(packageDir, "different_extension/config.xml"))
+assert xml.connectionStrings[0].add[0].@connectionString == "from-package-transform"
+
+assert new File(packageDir, "different_extension/config.package.xml").exists() == false
+assert new File(packageDir, "different_extension/config.otherhint.xml").exists() == false
+assert new File(packageDir, "different_extension/excluded.xml").exists() == false
+
+assert new File(packageDir, "pom.xml").exists() == false
+
+return true;
Added: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/web.config
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/web.config?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/web.config (added)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/web.config Mon Jan 16 21:47:30 2012
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ 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.
+ -->
+
+<configuration>
+ <connectionStrings>
+ <add name="name" connectionString="original"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/web.package.config
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/web.package.config?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/web.package.config (added)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/it/IT004_ConfigurationHandling/web.package.config Mon Jan 16 21:47:30 2012
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!--
+ ~ 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.
+ -->
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+ <connectionStrings>
+ <add name="name"
+ connectionString="from-package-transform"
+
+ xdt:Transform="Replace"
+ xdt:Locator="Match(name)"/>
+ </connectionStrings>
+</configuration>
Added: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/AbstractNPandayMojo.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/AbstractNPandayMojo.java?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/AbstractNPandayMojo.java (added)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/AbstractNPandayMojo.java Mon Jan 16 21:47:30 2012
@@ -0,0 +1,103 @@
+/*
+ * 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.aspnet;
+
+import com.google.common.base.Splitter;
+import org.apache.maven.plugin.AbstractMojo;
+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 static com.google.common.collect.Iterables.toArray;
+
+/**
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public abstract class AbstractNPandayMojo
+ extends AbstractMojo
+{
+ public Splitter SPLIT_ON_SEMICOLON = Splitter.on( ';' ).omitEmptyStrings().trimResults();
+
+ /**
+ * If the execution of this goal is to be skipped.
+ *
+ * @parameter
+ */
+ protected boolean skip;
+
+ /**
+ * The maven project.
+ *
+ * @parameter expression="${project}"
+ * @required
+ */
+ protected MavenProject project;
+
+ /**
+ * The maven project helper.
+ *
+ * @component
+ */
+ protected MavenProjectHelper projectHelper;
+
+ public final void execute() throws MojoExecutionException, MojoFailureException
+ {
+ if ( skip )
+ {
+ getLog().info(
+ "NPANDAY-126-000: Execution of '" + getClass().getSimpleName() + "' was skipped by configuration."
+ );
+ return;
+ }
+
+ setupParameters();
+
+ innerExecute();
+ }
+
+ protected void setupParameters()
+ {
+
+ }
+
+ protected String[] firstNonNull( String commandlineValues, String[] configurationValues )
+ {
+ return firstNonNull( commandlineValues, configurationValues, new String[0] );
+ }
+
+ protected String[] firstNonNull( String commandlineValues, String[] configurationValues, String[] defaultValue )
+ {
+ if ( commandlineValues != null )
+ {
+ return toArray(
+ SPLIT_ON_SEMICOLON.split( commandlineValues ), String.class
+ );
+ }
+
+ if (configurationValues != null){
+ return configurationValues;
+ }
+
+ return defaultValue;
+ }
+
+ protected abstract void innerExecute() throws MojoExecutionException, MojoFailureException;
+}
\ No newline at end of file
Added: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/AbstractNPandaySettingsAwareMojo.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/AbstractNPandaySettingsAwareMojo.java?rev=1232177&view=auto
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/AbstractNPandaySettingsAwareMojo.java (added)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/AbstractNPandaySettingsAwareMojo.java Mon Jan 16 21:47:30 2012
@@ -0,0 +1,80 @@
+/*
+ * 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.aspnet;
+
+import npanday.registry.RepositoryRegistry;
+import npanday.vendor.SettingsUtil;
+import npanday.vendor.VendorRequirement;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+/**
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public abstract class AbstractNPandaySettingsAwareMojo
+ extends AbstractNPandayMojo
+{
+
+ /**
+ * @parameter expression="${npanday.settings}" default-value="${user.home}/.m2"
+ */
+ protected String settingsPath;
+
+ /**
+ * The vendor of the framework, the executable is provided by or compatible with.
+ *
+ * @parameter expression="${vendor}"
+ */
+ protected String vendor;
+
+ /**
+ * The version of the framework vendor, the executable is provided by or compatible with.
+ *
+ * @parameter expression="${vendorVersion}"
+ */
+ protected String vendorVersion;
+
+ /**
+ * The framework version, the executable is compatible with.
+ *
+ * @parameter expression = "${frameworkVersion}"
+ */
+ protected String frameworkVersion;
+
+ /**
+ * @component
+ */
+ protected RepositoryRegistry repositoryRegistry;
+
+ /**
+ * @component
+ */
+ protected npanday.executable.NetExecutableFactory netExecutableFactory;
+
+ @Override
+ protected void innerExecute() throws MojoExecutionException, MojoFailureException
+ {
+ SettingsUtil.applyCustomSettings( getLog(), repositoryRegistry, settingsPath );
+ }
+
+ protected VendorRequirement getVendorRequirement(){
+ return new VendorRequirement( vendor, vendorVersion, frameworkVersion);
+ }
+}
Copied: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/ProcessWebConfigsMojo.java (from r1231089, incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/ProcessWebConfigMojo.java)
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/ProcessWebConfigsMojo.java?p2=incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/ProcessWebConfigsMojo.java&p1=incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/ProcessWebConfigMojo.java&r1=1231089&r2=1232177&rev=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/ProcessWebConfigMojo.java (original)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/main/java/npanday/plugin/aspnet/ProcessWebConfigsMojo.java Mon Jan 16 21:47:30 2012
@@ -19,36 +19,83 @@
package npanday.plugin.aspnet;
+import com.google.common.collect.Lists;
import npanday.PathUtil;
import npanday.packaging.ConfigFileHandler;
-import org.apache.maven.plugin.AbstractMojo;
+import npanday.vendor.VendorRequirement;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
import java.io.File;
+import java.util.List;
/**
- * TODO: document, when config handling is figured out
+ * Finds, transforms and copies arbitrary configuration files for packaging.
*
* @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- *
* @phase prepare-package
- * @goal process-web-config
+ * @goal process-configs
* @since 1.5.0-incubating
*/
-public class ProcessWebConfigMojo
- extends AbstractMojo
+public class ProcessWebConfigsMojo
+ extends AbstractNPandaySettingsAwareMojo
{
/**
- * @parameter default-value="false"
+ * The transformation to apply to the configurations
+ * specified in {@link #configIncludes}.
+ *
+ * The Mojo will search for transformations by 'injecting' the
+ * configured hint between a file name and its extension:
+ * <code><file-name>.<transformation-hint>.<file-extension></code>.
+ *
+ * @parameter default-value="package"
+ */
+ private String transformationHint;
+
+ /**
+ * Expressions for config files to additionally include further configuration files that
+ * need to be copied and/or transformed.
+ *
+ * Defaults to <code>*.config</code>, if not overridden by {@see configIncludesList}.
+ *
+ * Transformations are automatically excluded from being processed as main configs,
+ * while a transformation is detected as such, if it follows the format described in {@see #transformationHint}
+ * and a potential target file (without the hint) exists.
+ *
+ * @parameter
+ */
+ private String[] configIncludes;
+
+ /**
+ * Expressions for config files to explicitely exclude from config processing.
+ *
+ * <code>pom.xml</code> will always be excluded by default.
+ *
+ * @parameter
*/
- private boolean skip;
+ private String[] configExcludes;
/**
- * @parameter default-value="${basedir}/web.package.config"
+ * Semicolon-separated command line version of {@link #configIncludes}
+ *
+ * @parameter expression="${config.includes}"
*/
- private File webConfig;
+ private String configIncludesList;
+
+ /**
+ * Semicolon-separated command line version of {@link #configExcludes}
+ *
+ * @parameter expression="${config.excludes}"
+ */
+ private String configExcludesList;
+
+ /**
+ * Place to store temporary files for the transformation process.
+ *
+ * @parameter default-value="${project.build.directory}/xdt"
+ */
+ private File workingFolder;
/**
* The maven project.
@@ -63,20 +110,36 @@ public class ProcessWebConfigMojo
*/
protected ConfigFileHandler configFileHandler;
- public void execute() throws MojoExecutionException, MojoFailureException
+ @Override
+ protected void setupParameters()
{
- if ( skip )
- {
- getLog().info( "NPANDAY-132-000: Automatic handling of web.config was skipped by configuration" );
- return;
- }
-
- final File sourceConfigFile = webConfig;
- File targetConfigFile = new File(
- PathUtil.getPreparedPackageFolder( project ), "web.config"
+ configIncludes = firstNonNull(
+ configIncludesList, configIncludes, new String[]{ "**/*.config" }
);
+ configExcludes = firstNonNull( configExcludesList, configExcludes );
+ }
- configFileHandler.handleConfigFile( sourceConfigFile, targetConfigFile );
+ @Override
+ protected void innerExecute() throws MojoExecutionException, MojoFailureException
+ {
+ super.innerExecute();
+
+ final List<String> excludes = Lists.newArrayList( configExcludes );
+
+ final String[] includes = configIncludes;
+ final File targetFolder = PathUtil.getPreparedPackageFolder( project );
+
+ configFileHandler.setWorkingFolder( workingFolder );
+
+ final VendorRequirement vendorRequirement = getVendorRequirement();
+
+ if ( includes.length > 0 )
+ {
+ configFileHandler.handleConfigFiles(
+ vendorRequirement, project.getBasedir(), includes, excludes.toArray( new String[0] ),
+ transformationHint, targetFolder
+ );
+ }
}
Modified: incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/site/apt/usage.apt.vm
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/site/apt/usage.apt.vm?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/site/apt/usage.apt.vm (original)
+++ incubator/npanday/trunk/plugins/aspnet-maven-plugin/src/site/apt/usage.apt.vm Mon Jan 16 21:47:30 2012
@@ -32,13 +32,15 @@ Using the NPanday ASP.NET Maven Plugin
<execution>
<goals>
<goal>assemble-package-files</goal>
- <goal>process-web-config</goal>
+ <goal>process-configs</goal>
</goals>
</execution>
</executions>
</plugin>
+---+
- Read more about how to control which files to include and not to include here:
+ Read more about configuration transformations and how to control
+ which file includes/excludes here in the
{{{../../guide/advanced/application-packaging.html}.NET Application Packaging}}
+ section.
Modified: incubator/npanday/trunk/plugins/msdeploy-maven-plugin/src/main/java/npanday/plugin/msdeploy/MsDeployCreatePackageMojo.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/msdeploy-maven-plugin/src/main/java/npanday/plugin/msdeploy/MsDeployCreatePackageMojo.java?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/msdeploy-maven-plugin/src/main/java/npanday/plugin/msdeploy/MsDeployCreatePackageMojo.java (original)
+++ incubator/npanday/trunk/plugins/msdeploy-maven-plugin/src/main/java/npanday/plugin/msdeploy/MsDeployCreatePackageMojo.java Mon Jan 16 21:47:30 2012
@@ -31,8 +31,8 @@ import static com.google.common.collect.
* Picks up a prepared package folder and packages it using the MSDeploy command line tool.
*
* @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- * @goal create-package
* @phase package
+ * @goal create-package
*/
public class MsDeployCreatePackageMojo
extends AbstractMsDeployMojo<CreatePackageIterationItem>
Modified: incubator/npanday/trunk/plugins/msdeploy-maven-plugin/src/site/apt/usage.apt.vm
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/msdeploy-maven-plugin/src/site/apt/usage.apt.vm?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/msdeploy-maven-plugin/src/site/apt/usage.apt.vm (original)
+++ incubator/npanday/trunk/plugins/msdeploy-maven-plugin/src/site/apt/usage.apt.vm Mon Jan 16 21:47:30 2012
@@ -58,7 +58,7 @@ Using the NPanday ASP.NET Maven Plugin
<execution>
<goals>
<goal>assemble-package-files</goal>
- <goal>process-web-config</goal>
+ <goal>process-configs</goal>
</goals>
</execution>
</executions>
Modified: incubator/npanday/trunk/plugins/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/pom.xml?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/pom.xml (original)
+++ incubator/npanday/trunk/plugins/pom.xml Mon Jan 16 21:47:30 2012
@@ -178,6 +178,38 @@
<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>
+ <showErrors>true</showErrors>
+ <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>
+ <profile>
<id>apache-docs</id>
<distributionManagement>
<site>
Modified: incubator/npanday/trunk/plugins/wix-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/wix-maven-plugin/pom.xml?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/wix-maven-plugin/pom.xml (original)
+++ incubator/npanday/trunk/plugins/wix-maven-plugin/pom.xml Mon Jan 16 21:47:30 2012
@@ -61,41 +61,4 @@
</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 http://npanday.codeplex.com/WorkItem/View.aspx?WorkItemId=10557
- <localRepositoryPath>target/local-repo</localRepositoryPath> -->
- <postBuildHookScript>verify.bsh</postBuildHookScript>
- <filterProperties>
- <npandayVersion>${bootstrap.npanday.version}</npandayVersion>
- </filterProperties>
- </configuration>
- <executions>
- <execution>
- <id>integration-test</id>
- <goals>
- <goal>install</goal>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>
Modified: incubator/npanday/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/pom.xml?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/pom.xml (original)
+++ incubator/npanday/trunk/pom.xml Mon Jan 16 21:47:30 2012
@@ -481,6 +481,11 @@ under the License.
</dependency>
<dependency>
<groupId>org.apache.npanday</groupId>
+ <artifactId>dotnet-msbuild</artifactId>
+ <version>1.5.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.npanday</groupId>
<artifactId>dotnet-packaging</artifactId>
<version>1.5.0-incubating-SNAPSHOT</version>
</dependency>
Modified: incubator/npanday/trunk/site/src/site/apt/guide/advanced/application-packaging.apt.vm
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/site/src/site/apt/guide/advanced/application-packaging.apt.vm?rev=1232177&r1=1232176&r2=1232177&view=diff
==============================================================================
--- incubator/npanday/trunk/site/src/site/apt/guide/advanced/application-packaging.apt.vm (original)
+++ incubator/npanday/trunk/site/src/site/apt/guide/advanced/application-packaging.apt.vm Mon Jan 16 21:47:30 2012
@@ -45,6 +45,21 @@ Packaging Applications in NPanday
these is delivered by each its plugin, the {{{../../plugins/aspnet-maven-plugin/index.html}aspnet-maven-plugin}}
and {{{../../plugins/aspnet-maven-plugin/index.html}application-maven-plugin}}.
+* Apply configuration transformations
+
+ NPanday supports configuration transformations through
+ {{{http://msdn.microsoft.com/en-us/library/dd465326.aspx}Microsoft Xml Document Transform}}, also called XDT. This
+ enables modifications for config files before they make it into the package. While Visual Studio (2008+) only supports
+ XDT for web.config, NPanday can apply it to all config files, even with other extensions than <<<*.config>>>
+
+ By default, NPanday will transform all <<<<name>.config>>> files using a corresponding XDT transformation named
+ <<<<name>.package.config>>>.
+
+ <<XDT currently only works with .NET 3.5 and 4.0!>>
+
+ Read about the <<<process-configs>>> goals in the plugin reference for packaging mojos in order to find out, how you
+ tweak the config handling.
+
* Take control over what gets packaged
NPandays packaging plugins try to find sensible defaults for the required package format, but those can be overridden