是否可以通过 maven 命令对配置文件进行版本控制和部署到 nexus

is it possible to version and deploy a configuration file to nexus via maven commands

我正在做一个 java 项目,我想在 nexus 上对配置文件进行版本控制和存储。让我们假设 java 项目的文件结构如下。

src/  
conf/application.config  
pom.xml

当我 运行 mvn clean install 时,是否可以将 application.config 文件部署到 nexus。在每次构建之后,我希望将一个应用程序工件和一个配置工件部署到 nexus。是否有用于此目的的 Maven 插件。

我成功地使用 maven-deploy-plugin 部署了文件。

http://maven.apache.org/plugins/maven-deploy-plugin/usage.html

您可以在下面找到示例。

 <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
                <executions>
                    <execution>
                        <id>deploy-file</id>
                        <!-- change to deploy-->
                        <phase>install</phase>
                        <goals>
                            <goal>deploy-file</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <file>app.properties</file>
                    <repositoryId>stack.example.release</repositoryId>
                    <url>http://nexusserver/nexus/content/repositories/releases/</url>
                    <groupId>com.stack.example.config</groupId>
                    <artifactId>app</artifactId>
                    <packaging>properties</packaging>
                    <version>1.0.0</version>
                </configuration>
            </plugin>

        </plugins>
    </build>