using maven-eclipse-plugin for to specifiy depedency jar files from a folder into eclipse project, not M2_REPO variable

StackOverflow https://stackoverflow.com/questions/12910516

Domanda

I would like that the JAR build-path (or jar files in the build-path) of and eclipse project pointed to a local directory into eclipse project named "lib", not pointed to M2_REPO variable (my maven local repository path)

In lib directory, there are jar files copied through overriding 'copy-dependencies' goal in 'mave-dependency-plugin' My intention is that eclipse project were self-contained.

I tried overriding goals configure-workspace and from maven-eclipse-plugin, but it don't works.

¿is there way for to do this?

È stato utile?

Soluzione

I suggest to try one of the following ways:

  • Use a Maven Repository Manager such as Nexus and deploy any jar you have which are not in an available repository. Then use "normal" Maven dependencies.
  • Use system Maven dependencies.

Altri suggerimenti

Sure you can override the .classpath generated using the maven-eclipse-plugin

  <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>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top