[英]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.