4

Applications built on top of the NetBeans platform have a <myappdir>/etc/<myapp>.conf file determining, among other things, application JVM parameters. Historically, this file was a part of the NetBeans IDE installation (as far as I could tell), but starting with NB 6.9, custom files are now supported.

I am having trouble packaging a custom configuration file using Maven to build the application.

I imagine the app.conf property should have been set in the project's pom under project/build/pluginManagement/plugins like so:

<plugin>
 ...
    <configuration>
        <brandingToken>${brandingToken}</brandingToken>
        <cluster>${brandingToken}</cluster>
        <appConf>myapp.conf</appConf>
    </configuration>

The maven module representing my application contained no prior source, so I created the src/main/nbm folder and placed myapp.conf in src/main/nbm. This isn't picked up by nbm-maven-plugin. and putting the conf file into src/main/resources doesn't make a difference.

So, can anyone explain how a NetBeans Platform application with a custom configuration file can be built using maven?

UPDATE:

With Tim's prod in the right direction, I found the answer documented on Geertjan's blog. The solution is to configure the nbm-maven-plugin like so in the application module pom:

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>nbm-maven-plugin</artifactId>
            <configuration>
                <etcConfFile>src/main/resources/my.conf</etcConfFile>
            </configuration>
        </plugin>
    </plugins>
</build>

BTW, if you need a second name with Geertjan, you're not really a NetBeans platform developer. ;)

Tomislav Nakic-Alfirevic
  • 10,017
  • 5
  • 38
  • 51
  • agree 100% with the Geertjan comment, his blog is a treasure trove of NetBeans platform information. Also don't forget the NetBeans Platform Developer Mailing List - dev@platform.netbeans.org – Tim Sparg Jul 04 '11 at 19:35

1 Answers1

3

Have a look at the documentation of the nbm:cluster-app plugin, specifically the part on the conf file.

As per my understanding that should allow you to replace the default one with a custom one that you create.

Tim Sparg
  • 3,294
  • 2
  • 27
  • 40