将源从一个 Maven 项目复制到另一个项目
我正在尝试将源从 Maven 多模块 Web 项目复制到 Maven-Android 项目。这需要完成,因为源代码(我想将其保留在另一个平台的 android 项目之外)需要在 Dalvik 下编译才能在 android 上运行。除此之外,在 Android 上运行时不会打包依赖项,但使用 Dalvik 进行编译的需要掩盖了这一限制。
我发现的最接近该问题的文档 这里。
我使用 mvn dependency:unpack 将源代码解压到 eclipse 中的 android 项目。在此之前,我需要运行 mvn install 将源安装到本地存储库。然后我必须刷新 eclipse android 项目。
理想的情况是直接与 m2eclipse 一起使用,而不需要三步手动过程。
将不胜感激任何意见。
谢谢 sfk
Am trying to copy sources from a maven multi-module web project to a maven-android project. This needs to be done as the sources (which I want to keep outside of the android project for another platform) need to be compiled under Dalvik in order to be run on android. Aside from that, dependencies are not packaged when running on android, but the need for compiling using Dalvik overshadows this limitation.
The closest documentation of the issue I found here.
Am using mvn dependency:unpack to unpack the sources to the android project in eclipse. Prior to this I need to run mvn install to install the sources to the local repository. Then I have to refresh the eclipse android project.
The ideally scenario would be for this to work directly with m2eclipse without the three step manual process.
Would appreciate any inputs.
Thanks
sfk
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议将公共源从网络项目中提取到他们自己的项目中。
新项目应配置为生成两个工件:
这可以通过在 maven 命名 坐标 (groupId:artifactId:packaging:classifier:version)。
请参阅 http://code.google.com/p/maven-android-插件/wiki/ApkLib
I would suggest lifting the common sources out of the web-project into their own project.
The new project should be configured to produce two artifacts:
This could be done by defining a secondary attached artifact with in the maven naming co-ordinates (groupId:artifactId:packaging:classifier:version).
see http://code.google.com/p/maven-android-plugin/wiki/ApkLib