maven属性插件:运行时的奇怪行为;“mvn部署”;

maven属性插件:运行时的奇怪行为;“mvn部署”;,maven,Maven,我有一个关于maven属性插件的问题。 我的问题有点与 按照那篇文章的建议,我已经设法让它做了我想让它做的大部分事情。 我的配置如下所示: <dependency> <groupId>org.kuali.maven.plugins</groupId> <artifactId>properties-maven-plugin</artifactId> <version>1.0.8</version

我有一个关于maven属性插件的问题。 我的问题有点与

按照那篇文章的建议,我已经设法让它做了我想让它做的大部分事情。 我的配置如下所示:

<dependency>
    <groupId>org.kuali.maven.plugins</groupId>
    <artifactId>properties-maven-plugin</artifactId>
    <version>1.0.8</version>
</dependency>
...


<plugin>
    <groupId>org.kuali.maven.plugins</groupId>
        <artifactId>properties-maven-plugin</artifactId>
        <version>1.0.8</version>

    <executions>
        <execution>
            <phase>initialize</phase>
            <goals>
                <goal>read-project-properties</goal>
            </goals>
            <configuration>
                <files>
                    <file>${basedir}/${environment}.properties</file>
                </files>
            </configuration>
        </execution>
    </executions>
</plugin>
<distributionManagement>
    <repository>
        <id>localRep</id>
        <url>file:${localRepositoryLocation}</url>
    </repository>
</distributionManagement>
另外,我应该注意到,我在mojo版本中也使用了该插件,它产生了完全相同的行为。 因此,如果来自两个不同提供商的同一个插件具有相同的结果,那么一定是我做错了什么

有人能帮忙吗

亲切问候,,
Andrei

首先,两个插件都不同。原始文件在
1.0-alpha-2
中提供,目标
属性:读取项目属性的配置要求文件属性:


etc/config/dev.properties
1.1.10
中提供,与原始插件相比是一个扩展版本,配置需要location属性:


类路径:META-INF/spring/database.properties
在这里您可以看到改进,引用插件代码:

可以找到属性文件的位置。Spring资源加载可以理解的任何url都是有效的。例如
classpath:myprops.properties
。.properties和.xml样式的属性都受支持

代码中的问题是示例(来自codehaus文档)是错误的。正确的配置如下所示:


org.kuali.maven.plugins
属性maven插件
1.1.10
类路径:META-INF/spring/database.properties
初始化
读取项目属性

正如您所看到的,配置标签不在执行标签下。

首先,两个插件是不同的。原始文件在
1.0-alpha-2
中提供,目标
属性:读取项目属性的配置要求文件属性:


etc/config/dev.properties
1.1.10
中提供,与原始插件相比是一个扩展版本,配置需要location属性:


类路径:META-INF/spring/database.properties
在这里您可以看到改进,引用插件代码:

可以找到属性文件的位置。Spring资源加载可以理解的任何url都是有效的。例如
classpath:myprops.properties
。.properties和.xml样式的属性都受支持

代码中的问题是示例(来自codehaus文档)是错误的。正确的配置如下所示:


org.kuali.maven.plugins
属性maven插件
1.1.10
类路径:META-INF/spring/database.properties
初始化
读取项目属性
如您所见,配置标记不在执行标记下

[INFO] --- maven-deploy-plugin:2.5:deploy (default-deploy) @ SomeApp ---
Uploading: file:${localRepositoryLocation}/SomeApp/SomeApp/1.0.0/SomeApp-1.0.0.war
Uploaded: file:${localRepositoryLocation}/SomeApp/SomeApp/1.0.0/SomeApp-1.0.0.war (5754 KB at 18322.3 KB/sec)
Uploading: file:${localRepositoryLocation}/SomeApp/SomeApp/1.0.0/SomeApp-1.0.0.pom
Uploaded: file:${localRepositoryLocation}/SomeApp/SomeApp/1.0.0/SomeApp-1.0.0.pom (7 KB at 2051.1 KB/sec)