[英]How to generate eclipse project from maven with “Maven Dependencies” instead of “Referenced Libraries” “M2_REPO/..”
[英]using maven-eclipse-plugin for to specifiy depedency jar files from a folder into eclipse project, not M2_REPO variable
我希望and eclipse项目的JAR构建路径(或build-path中的jar文件)指向本地目录,该目录指向名为“ lib”的eclipse项目,而不指向M2_REPO变量(我的maven本地存储库路径)
在lib目录中,有一些jar文件是通过覆盖“ mave-dependency-plugin”中的“ copy-dependencies”目标复制的。我的意图是eclipse项目是独立的。
我尝试了覆盖目标configure-workspace和来自maven-eclipse-plugin的方法,但是它不起作用。
有没有办法做到这一点?
确保您可以覆盖使用maven-eclipse-plugin生成的.classpath
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<wtpversion>1.5</wtpversion>
<packaging>war</packaging>
<wtpContextName>${project.artifactId}</wtpContextName>
<buildOutputDirectory>WebContent/WEB-INF/classes</buildOutputDirectory>
<additionalConfig>
<file>
<name>.classpath</name>
<content><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" path="src/main/java"/>
<classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/project-lib"/>
<classpathentry kind="output" path="WebContent/WEB-INF/classes"/>
</classpath>]]></content>
</file>
</additionalConfig>
<buildcommands>
<buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
<buildcommand>org.eclipse.wst.common.project.facet.core.builder</buildcommand>
</buildcommands>
</configuration>
</plugin>
我建议尝试以下方法之一:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.