我可以在Eclipse中作为变量访问Maven属性吗?
问题描述:
我有一个Maven项目,该项目使用可以在本地配置文件中设置的属性来获取本地库的路径。例如:我可以在Eclipse中作为变量访问Maven属性吗?
<project>
...
<build>
...
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<environmentVariables>
<LD_LIBRARY_PATH>${foo.libdir}</LD_LIBRARY_PATH>
</environmentVariables>
<fork>always</fork>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>foo-default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<foo.libdir>/usr/local/lib</foo.libdir>
</properties>
</profile>
</profiles>
</project>
当我有这个项目在Eclipse中使用M2Eclipse plugin工作,我希望能够建立运行配置也引用这条道路在同为(例如,所以我可以在项目上运行Eclipse调试器)。有没有办法从Eclipse访问Maven属性,例如,可以在运行配置中使用像${maven_property:foo.libdir}
这样的变量来设置LD_LIBRARY_PATH
?