使用Maven2自动执行NSIS脚本构建 [英] Automating NSIS script build using maven2

查看:79
本文介绍了使用Maven2自动执行NSIS脚本构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用NSIS 2.46版开发了一个脚本,该脚本将为Windows生成安装程序.现在,我们希望借助maven来自动化生成安装程序的构建过程.

We have developed a script using NSIS Version 2.46 which would generate a installer for windows. Now that we would want to automate the build process of generating the installer by taking help of maven.

我们当前使用maven构建Java代码项目和构建最终产品.

We currently use maven for building our java code projects and for building our end product.

为使NSIS脚本的构建过程自动化,我无法找到支持NSIS脚本构建的Maven插件信息.

For automating the build process of NSIS script, I am not able to find the maven plugin information which supports NSIS script build.

我在Google上搜索了这些信息,但没有获得有关如何开始使用它的任何具体信息.

I googled for the information but I did not get any concrete information on how to start with it.

任何人都可以解释如何开始使用它,或指向我举一个例子说明这一点的页面吗?

Could anyone explain how to start with it or point me to a page which explains about this with an example?

推荐答案

尝试从 codehaus 进行尝试.

在安装或构建"makensis"之后,您应该可以将pom配置为如下所示:

After you install or build 'makensis', you should be able to configure your pom to look something like this:

    <!-- Codehause Snapshots - Nsis plugin needs this -->
    <pluginRepository>
        <id>Codehaus Snapshots</id>
        <url>http://nexus.codehaus.org/snapshots/</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <releases>
            <enabled>true</enabled>  <!-- Workaround for MNG-2974, see note below -->
        </releases>
    </pluginRepository>

   <!-- NSIS plugin for producing nsis installer -->
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>nsis-maven-plugin</artifactId>
            <version>1.0-SNAPSHOT</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>generate-project</goal>
                        <goal>compile</goal>
                    </goals>
                    <configuration>
                        <makensisBin>/usr/local/nsis/nsis-2.46/bin/makensis</makensisBin>
                        <setupScript>src/nsis/setup.nsi</setupScript>
                        <outputFile>${project.build.directory}/${project.build.finalName}.exe</outputFile>
                    </configuration>
                </execution>
            </executions>
        </plugin>

这篇关于使用Maven2自动执行NSIS脚本构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆