eclipse中的Maven依赖关系不会复制到WEB-INF / lib [英] Maven dependencies are not copied to WEB-INF/lib in eclipse

查看:138
本文介绍了eclipse中的Maven依赖关系不会复制到WEB-INF / lib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Eclipse中有一个maven Web项目(Spring Tool Suite是精确的),由于某种原因,我的maven依赖关系不会在WEB-INF / lib中结束,所以我得到各种运行时错误。这是在上周工作,我不知道采取了哪些行动才能停止工作。项目属性 - >部署程序集显示部署到WEB-INF / lib的Maven依赖关系,我已经尝试执行Maven - > Update Project,重新启动IDE,清理/安装等。这是我的POM:

 <?xml version =1.0encoding =UTF-8?> 
< project xmlns =http://maven.apache.org/POM/4.0.0xmlns:xsi =http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation =http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">
< modelVersion> 4.0.0< / modelVersion>
< groupId> com.ks< / groupId>
< artifactId> kdweb< / artifactId>
< name> kdweb< / name>
< packaging> war< / packaging>
< version> 1.0.0-BUILD-SNAPSHOT< / version>
<属性>
< org.springframework-version> 3.1.2.RELEASE< /org.springframework-version>
< org.slf4j-version> 1.5.10< /org.slf4j-version>
< / properties>
<依赖关系>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-context< / artifactId>
< version> $ {org.springframework-version}< / version>
<排除>
< exclude>
< groupId> commons-logging< / groupId>
< artifactId> commons-logging< / artifactId>
< / exclusion>
< / exclusions>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-webmvc< / artifactId>
< version> $ {org.springframework-version}< / version>
< / dependency>
<依赖关系>
< groupId> com.ks< / groupId>
< artifactId> acommons< / artifactId>
< version> 0.0.1-SNAPSHOT< / version>
< / dependency>
<依赖关系>
< groupId> com.ks< / groupId>
< artifactId> aggregation-common< / artifactId>
< version> 0.0.1-SNAPSHOT< / version>
< / dependency>
<依赖关系>
< groupId> javax.servlet< / groupId>
< artifactId> jstl< / artifactId>
< version> 1.2< / version>
< / dependency>
<依赖关系>
< groupId> commons-dbcp< / groupId>
< artifactId> commons-dbcp< / artifactId>
< version> 1.2.2< / version>
< / dependency>
<依赖关系>
< groupId> commons-pool< / groupId>
< artifactId> commons-pool< / artifactId>
< version> 1.6< / version>
< / dependency>
<依赖关系>
< groupId> org.codehaus.jackson< / groupId>
< artifactId> jackson-core-asl< / artifactId>
< version> 1.9.9< / version>
< / dependency>
<依赖关系>
< groupId> org.codehaus.jackson< / groupId>
< artifactId> jackson-mapper-asl< / artifactId>
< version> 1.9.9< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-asm< / artifactId>
< version> $ {org.springframework-version}< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-beans< / artifactId>
< version> $ {org.springframework-version}< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-core< / artifactId>
< version> $ {org.springframework-version}< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-expression< / artifactId>
< version> $ {org.springframework-version}< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-jdbc< / artifactId>
< version> $ {org.springframework-version}< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-tx< / artifactId>
< version> $ {org.springframework-version}< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-web< / artifactId>
< version> $ {org.springframework-version}< / version>
< / dependency>
<依赖关系>
< groupId> commons-digester< / groupId>
< artifactId> commons-digester< / artifactId>
< version> 2.1< / version>
< / dependency>
<依赖关系>
< groupId> javax.servlet< / groupId>
< artifactId> javax.servlet-api< / artifactId>
< version> 3.0.1< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-core< / artifactId>
< version> $ {org.springframework-version}< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-config< / artifactId>
< version> $ {org.springframework-version}< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-web< / artifactId>
< version> $ {org.springframework-version}< / version>
< / dependency>
<依赖关系>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-api< / artifactId>
< version> $ {org.slf4j-version}< / version>
< / dependency>
<依赖关系>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-log4j12< / artifactId>
< version> $ {org.slf4j-version}< / version>
< scope>运行时< / scope>
< / dependency>
<依赖关系>
< groupId> log4j< / groupId>
< artifactId> log4j< / artifactId>
< version> 1.2.15< / version>
<排除>
< exclude>
< groupId> javax.mail< / groupId>
< artifactId> mail< / artifactId>
< / exclusion>
< exclude>
< groupId> javax.jms< / groupId>
< artifactId> jms< / artifactId>
< / exclusion>
< exclude>
< groupId> com.sun.jdmk< / groupId>
< artifactId> jmxtools< / artifactId>
< / exclusion>
< exclude>
< groupId> com.sun.jmx< / groupId>
< artifactId> jmxri< / artifactId>
< / exclusion>
< / exclusions>
< scope>运行时< / scope>
< / dependency>
<依赖关系>
< groupId> junit< / groupId>
< artifactId> junit< / artifactId>
< version> 4.7< / version>
< scope> test< / scope>
< / dependency>
<依赖关系>
< groupId> com.ks.thirdparty< / groupId>
< artifactId> jconn< / artifactId>
< version> 3< / version>
< / dependency>
<依赖关系>
< groupId> com.ks< / groupId>
< artifactId> framework-common< / artifactId>
< version> 0.0.1-SNAPSHOT< / version>
< / dependency>
<依赖关系>
< groupId> com.ks.thirdparty< / groupId>
< artifactId> ojdbc6_g< / artifactId>
< version> 1.0< / version>
< / dependency>
<依赖关系>
< groupId> com.ks< / groupId>
< artifactId> abizcommons< / artifactId>
< version> 0.0.1-SNAPSHOT< / version>
< / dependency>
<依赖关系>
< groupId> com.ks< / groupId>
< artifactId> apods-client< / artifactId>
< version> 0.0.1-SNAPSHOT< / version>
< / dependency>
< / dependencies>
< build>
< plugins>
< plugin>
< artifactId> maven-eclipse-plugin< / artifactId>
< version> 2.9< / version>
< configuration>
< additionalProjectnatures>
< projectnature> org.springframework.ide.eclipse.core.springnature< / projectnature>
< / additionalProjectnatures>
< additionalBuildcommands>
< buildcommand> org.springframework.ide.eclipse.core.springbuilder< / buildcommand>
< / additionalBuildcommands>
< downloadSources> true< / downloadSources>
< downloadJavadocs> true< / downloadJavadocs>
< / configuration>
< / plugin>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-compiler-plugin< / artifactId>
< version> 2.3.2< / version>
< configuration>
< source> 1.6< / source>
< target> 1.6< / target>
< compilerArgument> -Xlint:all< / compilerArgument>
< showWarnings> true< / showWarnings>
< showDeprecation> true< / showDeprecation>
< / configuration>
< / plugin>
< plugin>
< groupId> org.codehaus.mojo< / groupId>
< artifactId> exec-maven-plugin< / artifactId>
< version> 1.2.1< / version>
< configuration>
< mainClass> org.test.int1.Main< / mainClass>
< / configuration>
< / plugin>
< plugin>
< groupId> org.codehaus.mojo< / groupId>
< artifactId> tomcat-maven-plugin< / artifactId>
< version> 1.1< / version>
< configuration>
< url> http:// xxxxxxxxxxxxxx / manager / text< / url>
< server> TomcatServer< / server>
< path> / kdweb< / path>
< / configuration>
< / plugin>
< / plugins>
< / build>
< distributionManagement>
< repository>
< id> xxxxxxxxxxxxxxxxxx< / id>
< name> xxxxxxxxxxxx-releases< / name>
< url> http:// xxxxxxxxxxxxxxx / artifactory / libs-release-local< / url>
< / repository>
< snapshotRepository>
< id> xxxxxxxxxx< / id>
< name> xxxxxxxxxx-snapshots< / name>
< url> http:// xxxxxxxxxxxx / artifactory / libs-snapshot-local< / url>
< / snapshotRepository>
< / distributionManagement>
< / project>


解决方案

由于您认为您的构建工作正常,到一个新的工作区,并重新创建你的项目。看看问题是否解决。


I have a maven web project in Eclipse (Spring Tool Suite to be precise), and for some reason my maven dependencies do not end up in WEB-INF/lib, so I get all sorts of runtime errors. This was working last week, and I'm not sure what action caused it to stop working. Project Properties -> Deployment Assembly shows Maven Dependencies deploying to WEB-INF/lib, and I've tried to do Maven -> Update Project, restart the IDE, clean/install, etc. Here is my POM:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.ks</groupId>
    <artifactId>kdweb</artifactId>
    <name>kdweb</name>
    <packaging>war</packaging>
    <version>1.0.0-BUILD-SNAPSHOT</version>
    <properties>
        <org.springframework-version>3.1.2.RELEASE</org.springframework-version>
        <org.slf4j-version>1.5.10</org.slf4j-version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${org.springframework-version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>
        <dependency>
            <groupId>com.ks</groupId>
            <artifactId>acommons</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.ks</groupId>
            <artifactId>aggregation-common</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.2.2</version>
        </dependency>
        <dependency>
            <groupId>commons-pool</groupId>
            <artifactId>commons-pool</artifactId>
            <version>1.6</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <version>1.9.9</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.9.9</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-asm</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-expression</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>
        <dependency>
            <groupId>commons-digester</groupId>
            <artifactId>commons-digester</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${org.slf4j-version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${org.slf4j-version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.15</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.jms</groupId>
                    <artifactId>jms</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jdmk</groupId>
                    <artifactId>jmxtools</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jmx</groupId>
                    <artifactId>jmxri</artifactId>
                </exclusion>
            </exclusions>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.7</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.ks.thirdparty</groupId>
            <artifactId>jconn</artifactId>
            <version>3</version>
        </dependency>
        <dependency>
            <groupId>com.ks</groupId>
            <artifactId>framework-common</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.ks.thirdparty</groupId>
            <artifactId>ojdbc6_g</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>com.ks</groupId>
            <artifactId>abizcommons</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.ks</groupId>
            <artifactId>apods-client</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <additionalProjectnatures>
                        <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
                    </additionalProjectnatures>
                    <additionalBuildcommands>
                        <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
                    </additionalBuildcommands>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>true</downloadJavadocs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <compilerArgument>-Xlint:all</compilerArgument>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <configuration>
                    <mainClass>org.test.int1.Main</mainClass>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tomcat-maven-plugin</artifactId>
                <version>1.1</version>
                <configuration>
                    <url>http://xxxxxxxxxxxxxx/manager/text</url>
                    <server>TomcatServer</server>
                    <path>/kdweb</path>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <distributionManagement>
        <repository>
            <id>xxxxxxxxxxxxxxxxxx</id>
            <name>xxxxxxxxxxxx-releases</name>
            <url>http://xxxxxxxxxxxxxxx/artifactory/libs-release-local</url>
        </repository>
        <snapshotRepository>
            <id>xxxxxxxxxx</id>
            <name>xxxxxxxxxx-snapshots</name>
            <url>http://xxxxxxxxxxxx/artifactory/libs-snapshot-local</url>
        </snapshotRepository>
    </distributionManagement>
</project>

解决方案

Since you metioned that your build was working, try switching to a new workspace and recreate your project. See if the problem is solved.

这篇关于eclipse中的Maven依赖关系不会复制到WEB-INF / lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆