我想启用m2e v 1.0中不可用的旧插件
我已将此添加到POM中,但如果有多个项目则不起作用.
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>[0.0.0,)</version>
<goals>
<goal>unpack</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>[0.0.0,)</version>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Run Code Online (Sandbox Code Playgroud)
我也试过以下变化.
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<lifecycleMappings>
<lifecycleMapping>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>[0.0.0,)</version>
<goals>
<goal>unpack</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMapping>
<lifecycleMapping>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter> …
Run Code Online (Sandbox Code Playgroud) 我在使Eclipse符合测试范围的Maven依赖项时遇到了一些问题 - 它出现在构建路径上并且弄乱了eclipse的编译/ javadoc解析.
我一直在使用该javaee-api-6.0
库来编译我的Java EE应用程序.
但是,出于单元测试的目的,我想访问的不仅仅是api - 我需要一个实现.所以我将嵌入式glassfish libs包含在这样的测试范围内:
<repositories>
<repository>
<id>glassfish-extras-repository</id>
<url>http://download.java.net/maven/glassfish/org/glassfish/extras</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.glassfish.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>3.1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>compile</scope>
<type>jar</type>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
根据我的理解,由于<scope>test</scope>
玻璃鱼依赖性,它不会被包括在常规compile
阶段.
因为这两个依赖项都将包含在test-compile
阶段中,所以我确定将glassfish依赖项置于javaee-api依赖项之前,以便在编译测试类时优先使用前者.因此,当仅使用Maven构建时,此配置不是问题.
但是,当使用m2e和Eclipse时,glassfish依赖项列在我的构建路径中:
因为在java-ee-api依赖项之前列出了glassfish依赖项,所以Eclipse似乎使用错误的lib(glassfish而不是java-ee-api)来验证/编译/查找javadoc.(实际上,我并不是100%确定编译使用的是错误的lib - 这取决于是否在Eclipse下使用Maven来执行验证代码时使用的编译,而且我不知道它是否存在 - 但是javadoc查找肯定引用了错误的lib)
除了在运行单元测试时,如何阻止Eclipse使用glassfish lib?我想确保我的编译/ javadoc查找在api上发生,而不是该api的特定实现.
我正在使用eclipse上的maven 2项目,我有m2e插件,我在Eclipse中遇到以下错误:
Failure to transfer com.thoughtworks.xstream:xstream:pom:1.3.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 transfer artifact com.thoughtworks.xstream:xstream:pom:1.3.1 from/to central (http://
repo1.maven.org/maven2): Failed to create a selector. to http://repo1.maven.org/maven2/com/thoughtworks/xstream/
xstream/1.3.1/xstream-1.3.1.pom
Run Code Online (Sandbox Code Playgroud)
我通过删除.lastUpdated文件然后清理和构建没有运气,仍然得到相同的错误,请遵循类似问题的答案,请指教.
如果我创建新Maven
项目Eclipse
并将其基于快速启动原型,它将显示J2SE-1.5
在Java Build Path
窗口中,Java Compiler / JDK Compliance
窗口中显示1.5 .
所以,我通常必须手动将其更改为其他Java.
这些默认设置来自哪里?
如何更改为1.6或1.7?
我在日食上遇到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)
我该如何避免这种奇怪的行为?
我有一个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) 我知道以前有人问过这个问题,但我仍在努力解决这个问题。当我将项目加载到 eclipse 中时,出现以下异常:
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-antrun-plugin:1.7:run (execution: generate-webapp-name, phase: compile)
Run Code Online (Sandbox Code Playgroud)
我的 maven 项目由许多模块(> 200)组成,它会导致所有模块出现问题。
我尝试忽略我的(在父模块中)run
和compile
目标pom.xml
:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<versionRange>[1.7,)</versionRange>
<goals>
<goal>compile</goal>
<goal>run</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore/>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
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)