NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

filtering copy with maven nbm-maven-plugin of etc app.conf file

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
clebaudy



Joined: 06 Oct 2009
Posts: 34

PostPosted: Tue Mar 02, 2010 12:18 pm    Post subject: filtering copy with maven nbm-maven-plugin of etc app.conf file Reply with quote

Hello,

anybody knows if filtering is supported when specifying use of a custom etc file in a netbeans application platform when using maven nbm-maven-plugin ?

I need to replace some values inside my (branding).conf file set to etc directory, so I used the maven-resources-plugin to perform it before the branding app but I am not satisfied of the workaround :
Code:

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>nbm-maven-plugin</artifactId>
                <configuration>
                    <finalName>${parent.artifactId}</finalName>
                    <etcConfFile>${basedir}/target/${brandingToken}.conf</etcConfFile>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.4.1</version>
                <executions>
                    <execution>
                        <id>generate-app-conf-file</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/etc</directory>
                                    <includes>
                                        <include>${brandingToken}.conf</include>
                                    </includes>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Is there any more simplier way to do it by specifying filtering directly through the nbm-maven-plugin ?
Back to top
Milos Kleint
Posted via mailing list.





PostPosted: Tue Mar 02, 2010 12:39 pm    Post subject: [platform-dev] Re: filtering copy with maven nbm-maven-plugin of etc app.conf file Reply with quote

there no special handling within the nbm-maven-plugin. The solution you found is IMHo the correct way to approach the issue.

Milos

On Tue, Mar 2, 2010 at 1:19 PM, clebaudy <address-removed ([email]address-removed[/email])> wrote:
Quote:
Hello,

anybody knows if filtering is supported when specifying use of a custom etc file in a netbeans application platform when using maven nbm-maven-plugin ?

I need to replace some values inside my (branding).conf file set to etc directory, so I used the maven-resources-plugin to perform it before the branding app but I am not satisfied of the workaround :
           <plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>nbm-maven-plugin</artifactId>
               <configuration>
                   <finalName>${parent.artifactId}</finalName>
                   <etcConfFile>${basedir}/target/${brandingToken}.conf</etcConfFile>
               </configuration>
           </plugin>
           <plugin>
               <artifactId>maven-resources-plugin</artifactId>
               <version>2.4.1</version>
               <executions>
                   <execution>
                       <id>generate-app-conf-file</id>
                       <phase>generate-resources</phase>
                       <goals>
                           <goal>copy-resources</goal>
                       </goals>
                       <configuration>
                           <outputDirectory>${basedir}/target/</outputDirectory>
                           <resources>
                               <resource>
                                   <directory>src/main/etc</directory>
                                   <includes>
                                       <include>${brandingToken}.conf</include>
                                   </includes>
                                   <filtering>true</filtering>
                               </resource>
                           </resources>
                       </configuration>
                   </execution>
               </executions>
           </plugin>

Is there any more simplier way to do it by specifying filtering directly through the nbm-maven-plugin ?




Back to top
bakers



Joined: 01 Apr 2010
Posts: 1

PostPosted: Thu Apr 01, 2010 12:49 pm    Post subject: replacing content during copy Reply with quote

have a look at: http://code.google.com/p/maven-replacer-plugin/
it can replace text content within a file and write it's output to a separate file
Back to top
clebaudy



Joined: 06 Oct 2009
Posts: 34

PostPosted: Thu Apr 01, 2010 2:02 pm    Post subject: Reply with quote

thanks bakers but all is ok since my first post.

resource copy plugin does all needed, I only wanted a more simplier way to do it.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo