[英]eclipse variable substitution before invoking maven
Is there a way to tell m2e to resolve eclipse variables before invoking maven? 有没有一种方法可以告诉m2e在调用Maven之前先解析日食变量? I have this configuration
我有这个配置
<plugin>
<!-- Done to create Target Platform needed by eclipse -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>process-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${workspace_loc}/project-OSGi/target/dependency</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
But ${workspace_loc}
doesn't get resolved before invoking maven so I end up with a folder called workspace_loc 但是
${workspace_loc}
在调用Maven之前没有得到解决,所以我最终得到一个名为workspace_loc的文件夹
My conclusion was that it's not possible to resolve eclipse variables before invoking maven. 我的结论是,在调用Maven之前无法解析日食变量。 The only workaround I found was using an environment variable in maven
{env.XX}
and eclipse ${env_var:XX}
, that way both maven and eclipse resolve to the same value 我发现的唯一解决方法是在maven
{env.XX}
和eclipse ${env_var:XX}
中使用环境变量,这样maven和eclipse都解析为相同的值
I believe ${workspace_loc}
is some CDT-specific Eclipse variable, isn't it? 我相信
${workspace_loc}
是一些CDT特定的Eclipse变量,不是吗?
What you need here is ${project.build.directory}
, which is the target
directory you need. 这里需要的是
${project.build.directory}
,这是您需要的target
目录。 You could also try a few other options, just type ${
and press Ctrl+Space , and it will show you all the usable properties and their actual resolved value as a hint. 您还可以尝试其他一些选项,只需键入
${
并按Ctrl + Space ,它将显示所有可用的属性及其实际解析值作为提示。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.