即使我有m2e,我也在Eclipse中与maven挣扎.
我从CVS检查了一个maven项目,无法在任何地方导航.如果我尝试参考>项目,我会弹出一个说:
"打开编辑器的问题原因:服务不存在".
services是主项目的名称,其中包含子项目.这一切都成功构建,所以我不确定为什么Eclipse不起作用.
我怀疑与classpath有关的东西,但不知道如何编辑它,因为它不能从项目的属性中获得.我实际上尝试手动创建.classpath文件,但它没有帮助.
我还将项目转换为maven项目,但这也没有帮助.
有任何想法吗?我正在使用Eclipse JUNO.
我正在尝试设置在Eclipse中为我的Android项目使用Maven和pom.xml文件.我有Eclipse Indigo设置(包括m2e),安装了Android SDK,安装了ADT.我正在努力理解"安装m2e-android-plugin"意味着什么(我总是被带到这个页面,它提供了安装它的说明,但我无法遵循)具体来说,当我浏览该页面上的指令时,在完成第2部分中的所有步骤后,我的结构没有"Maven Dependencies",我的pom.xml文件显示以下错误:
Project build error: Unresolveable build extension: Plugin
com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1 or one of its dependencies could
not be resolved: The following artifacts could not be resolved:
com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.1.1,
com.android.ddmlib:ddmlib:jar:r16, org.sonatype.sisu:sisu-inject-bean:jar:2.1.1,
org.sonatype.sisu:sisu-guice:jar:no_aop:2.9.4, org.codehaus.plexus:plexus- archiver:jar:2.0.1, junit:junit:jar:3.8.1,
org.codehaus.plexus:plexus-io:jar:2.0.1, org.codehaus.plexus:plexus-utils:jar:3.0, commons-jxpath:commons-
jxpath:jar:1.3, commons-io:commons-io:jar:2.0.1, org.ow2.asm:asm:jar:4.0, commons-lang:commons-lang:jar:
2.6, org.sonatype.aether:aether-util:jar:1.12: Failure to transfer
com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.1.1 from http://repo1.maven.org/
maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central
has elapsed or updates are forced. Original error: Could not …Run Code Online (Sandbox Code Playgroud) 我已经m2e在我的Eclipse Indigo中安装了Eclipse市场.
我是否需要maven显式安装并设置M2_HOME环境变量?
谢谢!
我在日食上遇到m2e的奇怪行为:
示例:在更新maven项目之前:
.settings/
src/
pom.xml
.gitignore
Run Code Online (Sandbox Code Playgroud)
更新maven项目后:
.settings/
src/
pom.xml
.gitignore
bin/ <------ this dir appears after update maven project
bin/.settings/ <----------- contents the same as outside dir
bin/src
bin/.gitignore
bin/pom.xml
Run Code Online (Sandbox Code Playgroud)
我该如何避免这种奇怪的行为?
我最近将项目构建从ant转换为maven和m2e,这工作正常,现在我突然每次保存文件时建筑工作区占用大约5到10秒的时间,以前是当我刚刚保存文件时,我甚至从未注意到eclipse会做任何事情.
我猜测m2e在增量构建期间正在做一些事情,这会减慢事情的速度.我不知道是什么导致了经济放缓.我正在寻找能够找出这种放缓原因的事情.
我可以采取哪些选项或步骤来帮助我找出导致此问题的原因.
更新:这是一个多模块项目,有17个模块16个罐子和一个战争.这是在标准maven层次结构中安排的.
更新:项目清洁在非常快的机器上需要大约30到85秒的挂钟时间.Web项目本身需要大约1秒才能构建,我无法判断问题是在m2e还是其他地方.
更新:保存.java文件会导致工作区重建,可能会以不可预测的方式重建0到15秒.
更新:我使用m2e-wtp扩展与工作区工件分辨率.
更新: m2e的日志文件的一些输出
2012-12-28 17:10:43,907 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-enforcer-plugin:1.2:enforce (execution: enforce-rules, phase: validate)
2012-12-28 17:10:43,907 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: ignore
2012-12-28 17:10:43,907 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: pl.project13.maven:git-commit-id-plugin:2.1.2:revision (execution: default, phase: initialize)
2012-12-28 17:10:43,907 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: ignore
2012-12-28 17:10:43,907 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Mojo execution key: org.apache.maven.plugins:maven-resources-plugin:2.6:resources (execution: default-resources, phase: process-resources)
2012-12-28 17:10:43,908 [Worker-3] DEBUG o.e.m.c.p.c.AbstractCustomizableLifecycleMapping - Action: execute
2012-12-28 …Run Code Online (Sandbox Code Playgroud) 一切进展顺利,包括从WSDL生成源代码,build-helper-maven-plugin但是当时间来"实现服务",RegistryResourceImpl.java即将生成的内容移动到正常的源文件夹时src/main/java,Eclipse开始抱怨某些符号(如界面RegistryResource)无法被识别.
意识到为普通src/main/java文件夹分配了不同的包名称,我只需在其所属RegistryResourceImpl.java的包的导入中添加RegistryResource.java:
import com.yourcompany.sample.ns.RegistryResource;
Run Code Online (Sandbox Code Playgroud)
但Eclipse目前的项目配置似乎是盲目的com.yourcompany.sample.ns,不知道在哪里找到它.
我尝试在Build Path中找到一个选项来指向生成的源,但没有尝试过我所帮助的.
我有一种感觉,我错过了一些非常微不足道的东西,但它是什么?
另外,不应该m2e(Eclipse的Maven插件)自动处理那种移动的实现文件?
更新(尝试@ Patrick建议的解决方案后):
target/generated/src/main/java 不存在,但检查"创建新文件夹"框,我能够创建它.Maven clean,它被删除(因此需要在每次清理后重新创建???)Maven install,在完全不同的树下创建生成源:generated-sources/cxf/com/yourcompany/sample/ns.为什么???RegistryResourceImpl.java模块仍然自动创建target/generated sources.在这一点上,我不再看到关于"未解决的包/进口/符号"的抱怨(奇怪).另一方面,如果我尝试添加作为"源文件夹"的实际生成的路径generated-sources/cxf/com/yourcompany/sample/ns(而不是不相关/不存在target/generated/src/main/java,生成的树target被移动(删除)到下面/src/main/java.我不明白这种行为日食.
最后,即使我在这里做了Maven> Update Project建议,从而摆脱了"Maven …
我有一个Android Maven项目,我正在尝试使用Eclipse.我也在使用Android Support v7 AppCompat库.在我的pom.xml中,我正在导入apklib和jar.我已经尝试更新到m2e-android插件的0.4.3-SNAPSHOT版本,但我仍然得到错误
Description Resource Path Location Type
dependency=[android.support:compatibility-v7-appcompat:apklib:18:compile] not found in workspace pom.xml /Studio54 line 1 me.gladwell.eclipse.m2e.android.markers.dependency.apklib
Run Code Online (Sandbox Code Playgroud)
这是我的pom.xml
http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.lhs.app Studio54 0.0.7-SNAPSHOT apk Studio54
<repositories>
<repository>
<id>ossSonatype</id>
<url>https://oss.sonatype.org/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<properties>
<platform.version>4.3_r1</platform.version>
</properties>
<dependencies>
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>${platform.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v4</artifactId>
<version>18</version>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v7-appcompat</artifactId>
<version>18</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v7-appcompat</artifactId>
<version>18</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.4</version>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>volley</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.testflight</groupId>
<artifactId>lib</artifactId> …Run Code Online (Sandbox Code Playgroud) 我使用带有m2e和m2e-wtp插件的Eclipse Kepler.
我需要自定义我的EAR模块的部署程序集,因为我正在使用Weblogic文件上的过滤,所以我想使用下面生成的文件/target/m2e-wtp/ear-resources而不是下面的文件/src/main/application.
为了做到这一点,我删除/src/main/application了部署程序集选项卡的源代码.
但是,如果我在EAR项目上右键单击Maven/Update Project,则m2e(或m2e-wtp?)插件会再次添加/src/main/application部署程序集选项卡中的目录.
有没有办法让插件部署配置不被插件覆盖?
pom.xml如果能有所帮助,我会把我的EAR模块放进去.
问候,
燕姿
我的Pom.xml:
<artifactId>projetx-sph-ear</artifactId>
<packaging>ear</packaging>
<name>projetx-sph-ear</name>
<description></description>
<!-- Projet parent -->
<parent>
<artifactId>projetx-sph-parent</artifactId>
<groupId>fr.sihm.eand</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<!-- Dépendances -->
<dependencies>
<!-- EJB -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>projetx-sph-ejb</artifactId>
<version>${project.version}</version>
<classifier>${envClassifier}</classifier>
<type>ejb</type>
<!--<classifier>${envClassifier}</classifier> -->
</dependency>
<!-- WAR -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>projetx-sph-web</artifactId>
<version>${project.version}</version>
<classifier>${envClassifier}</classifier>
<type>war</type>
<!--<classifier>${envClassifier}</classifier> -->
</dependency>
</dependencies>
<!-- Paramètres de build -->
<build>
<resources>
<resource>
<directory>src/main/application</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<pluginManagement>
<plugins> …Run Code Online (Sandbox Code Playgroud) 我的项目A依赖于Eclipse工作区中的项目B和C.
有时我希望A使用存储库中的工件B和C而不是工作空间中的版本来运行.因此,我选择A,然后选择'Maven-> Disable Workspace Resolution',以便A使用存储库中的版本.
但是,只要我采取上述操作,就会在项目A的pom文件中收到错误消息"Missing artifact B"和"Missing artifact C".
我试图清理项目,我选择'Maven | 选中"强制更新罐子/发布"选项更新''.没有这些解决了这个问题.
我是否正确使用'Maven->禁用工作区分辨率'?
附加信息:这些项目的确切版本在存储库中.实际上,如果我在工作空间中关闭项目B和C,项目A会愉快地使用B和C的存储库版本.
我在我的标记中看到以下错误(以及其他几个喜欢它):
Invalid classpath publish/export dependency C:/Users/LevineJ/.m2/repository/org/bouncycastle/bcmail-jdk14/1.38/bcmail-jdk14-1.38.jar.
The project contains another dependency with the same archive name.
Run Code Online (Sandbox Code Playgroud)
当我快速搜索时,我会bcmail-jdk14.1.jar在两个位置找到:
从我对这个主题的阅读(各种帖子/文章),我认为这与我看到的错误有关.有人可以提供一些信息:1.这个错误是什么意思?2.我将如何解决它?
如果它有帮助,我正在使用:
结果 mvn dependency:tree
C:\Users\LevineJ\Development\default-workspace\adweb>mvn dependency:tree
Picked up _JAVA_OPTIONS: -Dcom.gxs.common.configuration.proxy.envid=totcpa -Dcom.gxs.common.logging.configfilepath=C:\Users\LevineJ\Development\config\adweb\LogCfg.xml -Dcom.gxs.common.configuration.localenvid=adweb -Dcom.gxs.common.logging.sdklogfile=C:\Users\LevineJ\Development\config\adweb\tgo.log -Dcom.gxs.common.configuration.path=C:\Users\LevineJ\Development\config\adweb\CRC
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.gxs:adweb:war:${build.number}
[WARNING] 'version' contains an expression but should …Run Code Online (Sandbox Code Playgroud)