You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-users@incubator.apache.org by Sergio Rupena <sr...@247e.com> on 2010/10/11 23:12:09 UTC

packaging an application with the config file

 

I am trying to create a pom which allows me to bundle my 'app.config'
file together with my application. The documentation (see
http://www.npanday.org/docs/1.2/guide/maven/project-types.html
<http://www.npanday.org/docs/1.2/guide/maven/project-types.html> )
suggests that this should be possible using the dotnet-executable-config
packaging type.

 

Using the normal maven-compile plugin this should be doable using the
following pom:

 

<?xml version="1.0" encoding="utf-8"?>

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://maven.apache.org/POM/4.0.0">

  <modelVersion>4.0.0</modelVersion>

  <groupId>TestGroup</groupId>

  <artifactId>TestArtifactName.Config</artifactId>

  <packaging>dotnet-executable-config</packaging>

  <name>configuration file pom</name>

  <version>1.0-SNAPSHOT</version>

</project>

 

But this results in an error:

 

[INFO] Scanning for projects...

[INFO]
------------------------------------------------------------------------

[INFO] Building configuration file pom

[INFO]    task-segment: [install]

[INFO]
------------------------------------------------------------------------

[INFO]
------------------------------------------------------------------------

[ERROR] BUILD ERROR

[INFO]
------------------------------------------------------------------------

[INFO] Cannot find lifecycle mapping for packaging:
'dotnet-executable-config'.

Component descriptor cannot be found in the component repository:
org.apache.maven.lifecycle.mapping.LifecycleMappingdotnet-executable-con
fig.

[INFO]
------------------------------------------------------------------------

[INFO] For more information, run Maven with the -e switch

[INFO]
------------------------------------------------------------------------

[INFO] Total time: < 1 second

[INFO] Finished at: Tue Oct 12 01:10:08 CEST 2010

[INFO] Final Memory: 1M/15M

 

I am using npanday 1.2.1

 

Any help would be appreciated,

 

/joe


Re: packaging an application with the config file

Posted by Lars Corneliussen <me...@lcorneliussen.de>.
Hi Sergio,

dotnet-executable-config is not really a packaging, but rather only a 
dependency type. This means, there is no lifecycle bound by default: 
http://www.npanday.org/docs/1.2/guide/maven/project-types.html

You can use the build-helper-maven-plugin with the goal attach-artifact, 
to package a config together with its executable...
http://mojo.codehaus.org/build-helper-maven-plugin/usage.html Section 
"Attach additional artifacts to your project".

I think npanday will resolve the config together with the exe. If it 
doesn't, you add an extra dependency with the same group, name and 
version plus <type>dotnet-executable-config</type>

The Exe-Pom could look like this...

hope that helps,
-Lars

<?xml version="1.0" encoding="utf-8"?>

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://maven.apache.org/POM/4.0.0">

   <modelVersion>4.0.0</modelVersion>

   <groupId>TestGroup</groupId>

   <artifactId>TestArtifactName</artifactId>

   <packaging>dotnet-executable</packaging>

   <name>Executable-pom</name>

   <version>1.0-SNAPSHOT</version>

   <build>
     <plugins>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>build-helper-maven-plugin</artifactId>
         <version>1.5</version>
         <executions>
           <execution>
             <id>attach-artifacts</id>
             <phase>package</phase>
             <goals>
               <goal>attach-artifact</goal>
             </goals>
             <configuration>
               <artifacts>
                 <artifact>
                   <file>pathtobin/bin-name.exe.config</file>
                   <type>dotnet-executable-config</type>
                 </artifact>
               </artifacts>
             </configuration>
           </execution>
         </executions>
       </plugin>
     </plugins>
   </build>

</project>





Am 12.10.10 01:12, schrieb Sergio Rupena:
>
>
> I am trying to create a pom which allows me to bundle my 'app.config'
> file together with my application. The documentation (see
> http://www.npanday.org/docs/1.2/guide/maven/project-types.html
> <http://www.npanday.org/docs/1.2/guide/maven/project-types.html>  )
> suggests that this should be possible using the dotnet-executable-config
> packaging type.
>
>
>
> Using the normal maven-compile plugin this should be doable using the
> following pom:
>
>
>
> <?xml version="1.0" encoding="utf-8"?>
>
> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns="http://maven.apache.org/POM/4.0.0">
>
>    <modelVersion>4.0.0</modelVersion>
>
>    <groupId>TestGroup</groupId>
>
>    <artifactId>TestArtifactName.Config</artifactId>
>
>    <packaging>dotnet-executable-config</packaging>
>
>    <name>configuration file pom</name>
>
>    <version>1.0-SNAPSHOT</version>
>
> </project>
>
>
>
> But this results in an error:
>
>
>
> [INFO] Scanning for projects...
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO] Building configuration file pom
>
> [INFO]    task-segment: [install]
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO]
> ------------------------------------------------------------------------
>
> [ERROR] BUILD ERROR
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO] Cannot find lifecycle mapping for packaging:
> 'dotnet-executable-config'.
>
> Component descriptor cannot be found in the component repository:
> org.apache.maven.lifecycle.mapping.LifecycleMappingdotnet-executable-con
> fig.
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO] For more information, run Maven with the -e switch
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO] Total time:<  1 second
>
> [INFO] Finished at: Tue Oct 12 01:10:08 CEST 2010
>
> [INFO] Final Memory: 1M/15M
>
>
>
> I am using npanday 1.2.1
>
>
>
> Any help would be appreciated,
>
>
>
> /joe
>
>
>