如何将 Maven 依赖项添加到 Flex Builder 3 中的 Flex 构建路径?
我们使用 maven 来使用 flex-mojo 构建一个 Flex 项目,这非常棒。 问题是我无法将 pom 中指定的 SWC 依赖项添加到 Flex 构建路径中。 据我所知,Flex Builder 只允许您使用绝对路径,因此即使使用 m2eclipse 插件 添加 Maven 支持。
有没有人找到一种使用 Maven 和 Flex Builder 进行构建而不重复依赖项的方法?
We're using maven to build a flex project using flex-mojo's, which is great. The problem is I can't add the swc dependencies specified in the pom to the flex build path. As far as I can see Flex Builder only lets you use an absolute path, so it can't see the maven dependencies even when using the m2eclipse plugin to add maven support.
Has anyone found a way to build with both maven and Flex Builder without duplicating the dependencies?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Flex-mojos 现在支持使用 <代码>flexmojos:flexbuilder目标。 它对于嵌套项目来说并不完美,但似乎在所有其他情况下都能很好地工作。
Flex-mojos now supports doing this using the
flexmojos:flexbuilder
goal. It's not perfect for nested projects but seems to work well in all other cases.这不是一个特别优雅的答案,但它可能符合您的目的。
您可以使用 maven-dependency-plugin 将类路径输出到文件。 build-classpath 是相关目标。 下面的配置将把 Maven 的类路径输出到 [项目目录]/target/.mavenClasspath
您可以编写一个小脚本或 ant 任务来读取 .mavenClasspath 文件内容并将条目附加到 Eclipse .classpath。 如果您使脚本更加智能并删除以前的条目,则将其设置为 外部构建器,您拥有一个近乎集成的解决方案。
This is not a particularly elegant answer, but it may serve your purposes.
You can use the maven-dependency-plugin to output the classpath to a file. The build-classpath is the relevant goal. the configuration below will output Maven's classpath to [project directory]/target/.mavenClasspath
You could write a small script or ant task to read the .mavenClasspath file contents and append the entries to the Eclipse .classpath. If you make the script a bit smarter and remove previous entries, then set it up as an external builder, you have a nearly integrated solution.
Flex Builder 现在可以处理相对路径(请参阅错误报告); 您可以将它们添加到您的 .actionScriptProperties 中,如下所示:
Flex Builder can now handle relative paths (see bug report); you can add them to your .actionScriptProperties as follows: