方法中的Absent Code属性在类文件javax / persistence / InheritanceType中不是本机或抽象的 [英] Absent Code attribute in method that is not native or abstract in class file javax/persistence/InheritanceType

查看:557
本文介绍了方法中的Absent Code属性在类文件javax / persistence / InheritanceType中不是本机或抽象的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我试图写一个pomfile,它支持在eclipse中运行在服务器上运行unittests +。但是,m2eclipse忽略范围,并且始终将所有内容部署到服务器。



我得到

 code> java.lang.NoClassDefFoundError:javax / servlet / jsp / el / ELException 

因为我没有包含代码
的javaee-web-api,或者我得到

  .lang.LinkageError:加载器约束冲突:解析接口方法javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax / el / ExpressionFactory;当前类的类加载器(org / apache / catalina / loader / WebappClassLoader的实例),com / sun / faces / config / ConfigureListener和类加载器(org / apache / catalina / loader / StandardClassLoader的实例)用于已解决class,javax / servlet / jsp / JspApplicationContext对于类型avax / el / ExpressionFactory具有不同的Class对象;用于签名

因为ive包含他们的代码,但tomcat7也包括他们,所以我试图添加提供:

 <依赖关系> 
< groupId> org.jboss.spec< / groupId>
< artifactId> jboss-javaee-6.0< / artifactId>
< version> 1.0.0.Final< / version>
< type> pom< / type>
< scope>已提供< / scope>
< / dependency>

但是,当我从eclipse在服务器上运行它时,这些jar包含在classpath中。



POM.XML

 < 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/xsd/maven-4.0.0.xsd\">
< modelVersion> 4.0.0< / modelVersion>
< groupId> Lythgmbh< / groupId>
< artifactId> Sociato< / artifactId>
< version> 0.0.1-SNAPSHOT< / version>
< repositories>
< repository>
< id> central< / id>
< name> Maven Repository Switchboard< / name>
< url> http://repo1.maven.org/maven2< / url>
< layout> default< / layout>
< / repository>
< repository>
< id> central2< / id>
< name> Maven Repository Switchboard2< / name>
< url> http://repo2.maven.org/maven2< / url>
< layout> default< / layout>
< / repository>
< repository>
< id> prime-repo< / id>
< name> PrimeFaces Maven Repository< / name>
< url> http://repository.primefaces.org< / url>
< layout> default< / layout>
< / repository>
< repository>
< id> fuse-repo< / id>
< name>保险丝开源社区< / name>
< url> http://repo.fusesource.com/maven2< / url>
< layout> default< / layout>
< / repository>
< repository>
< id> jahia.org< / id>
< name> jahia.org< / name>
< url> http://maven.jahia.org/maven2< / url>
< layout> default< / layout>
< / repository>
< repository>
< id> asf-snapshot< / id>
< name> ASF Maven Repository< / name>
< layout> default< / layout>
< url> http://people.apache.org/maven-snapshot-repository< / url>
< / repository>
< repository>
< id> org.springframework.security.taglibs.facelets< / id>
< url> http://spring-security-facelets-taglib.googlecode.com/svn/repo/< / url>
< / repository>
< repository>
< id> repository.jboss.org-public< / id>
< name> JBoss存储库< / name>
< url> https://repository.jboss.org/nexus/content/groups/public< / url>
< / repository>
< / repositories>
<依赖关系>

<! - 其他 - >
<依赖关系>
< groupId> org.apache.commons< / groupId>
< artifactId> commons-lang3< / artifactId>
< version> 3.1< / version>
< / dependency>
<依赖关系>
< groupId> cglib< / groupId>
< artifactId> cglib< / artifactId>
< version> 2.2.2< / version>
< / dependency>
<依赖关系>
< groupId> postgresql< / groupId>
< artifactId> postgresql< / artifactId>
< version> 9.1-901-1.jdbc4< / version>
< / dependency>
<依赖关系>
< groupId> commons-httpclient< / groupId>
< artifactId> commons-httpclient< / artifactId>
< version> 3.1< / version>
< / dependency>
<依赖关系>
< groupId> jfree< / groupId>
< artifactId> jfreechart< / artifactId>
< version> 1.0.13< / version>
< / dependency>
<依赖关系>
< groupId> org.json< / groupId>
< artifactId> json< / artifactId>
< version> 20090211< / version>
< / dependency>
<依赖关系>
< groupId> log4j< / groupId>
< artifactId> log4j< / artifactId>
< version> 1.2.16< / version>
< type> jar< / type>
< scope> compile< / scope>
<排除>
< exclude>
< groupId> com.sun.jmx< / groupId>
< artifactId> jmxri< / artifactId>
< / exclusion>
< exclude>
< groupId> com.sun.jdmk< / groupId>
< artifactId> jmxtools< / artifactId>
< / exclusion>
< exclude>
< groupId> javax.jms< / groupId>
< artifactId> jms< / artifactId>
< / exclusion>
< / exclusions>
< / dependency>
<依赖关系>
< groupId> net.htmlparser.jericho< / groupId>
< artifactId> jericho-html< / artifactId>
< version> 3.2< / version>
< / dependency>
<依赖关系>
< groupId> junit< / groupId>
< artifactId> junit< / artifactId>
< version> 4.10< / version>
< / dependency>
<依赖关系>
< groupId> org.supercsv< / groupId>
< artifactId> supercsv< / artifactId>
< version> 1.20< / version>
< / dependency>
<依赖关系>
< groupId> com.octo.captcha< / groupId>
< artifactId> jcaptcha< / artifactId>
< version> 1.0< / version>
< / dependency>
<依赖关系>
< groupId> org.seleniumhq.selenium< / groupId>
< artifactId> selenium< / artifactId>
< version> 2.0rc2< / version>
< type> pom< / type>
<排除>
< exclude>
< artifactId> httpclient< / artifactId>
< groupId> org.apache.httpcomponents< / groupId>
< / exclusion>
< / exclusions>
< / dependency>
<依赖关系>
< groupId> org.openid4java< / groupId>
< artifactId> openid4java-consumer< / artifactId>
< version> 0.9.6< / version>
< type> pom< / type>
< / dependency>
<依赖关系>
< groupId> com.lowagie< / groupId>
< artifactId> itext< / artifactId>
< version> 2.1.7< / version>
< / dependency>
<依赖关系>
< groupId> org.quartz-scheduler< / groupId>
< artifactId> quartz< / artifactId>
< version> 1.8.6< / version>
< / dependency>
<依赖关系>
< groupId> net.sf.ehcache< / groupId>
< artifactId> ehcache< / artifactId>
< version> 2.5.1< / version>
< type> pom< / type>
< / dependency>
<依赖关系>
< groupId> com.sun.mail< / groupId>
< artifactId> javax.mail< / artifactId>
< version> 1.4.5< / version>
< / dependency>
<依赖关系>
< groupId> org.apache.lucene< / groupId>
< artifactId> lucene-core< / artifactId>
< version> 3.3.0< / version>
< / dependency>

<! - JSF - >
<依赖关系>
< groupId> javax.servlet< / groupId>
< artifactId> jstl< / artifactId>
< version> 1.2< / version>
< / dependency>
<依赖关系>
< groupId> com.sun.faces< / groupId>
< artifactId> jsf-impl< / artifactId>
< version> 2.1.7< / version>
< / dependency>
<依赖关系>
< groupId> com.sun.faces< / groupId>
< artifactId> jsf-api< / artifactId>
< version> 2.1.7< / version>
< / dependency>
<依赖关系>
< groupId> org.richfaces.ui< / groupId>
< artifactId> richfaces-components-api< / artifactId>
< version> 4.2.0.Final< / version>
< / dependency>
<依赖关系>
< groupId> org.richfaces.core< / groupId>
< artifactId> richfaces-core-api< / artifactId>
< version> 4.2.0.Final< / version>
< / dependency>
<依赖关系>
< groupId> org.primefaces< / groupId>
< artifactId>标题< / artifactId>
< version> 3.2< / version>
< / dependency>
<依赖关系>
< groupId> commons-el< / groupId>
< artifactId> commons-el< / artifactId>
< version> 1.0< / version>
< / dependency>
<依赖关系>
< groupId> org.richfaces.ui< / groupId>
< artifactId> richfaces-components-ui< / artifactId>
< version> 4.2.0.Final< / version>
< / dependency>
<依赖关系>
< groupId> org.richfaces.core< / groupId>
< artifactId> richfaces-core-impl< / artifactId>
< version> 4.2.0.Final< / version>
< / dependency>

<! - SPRING - >
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-context< / artifactId>
< version> 3.1.1.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-core< / artifactId>
< version> 3.1.1.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-web< / artifactId>
< version> 3.1.0.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-taglibs< / artifactId>
< version> 3.1.0.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-config< / artifactId>
< version> 3.1.0.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-aop< / artifactId>
< version> 3.1.1.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-web< / artifactId>
< version> 3.1.1.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-webmvc< / artifactId>
< version> 3.1.1.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-tx< / artifactId>
< version> 3.1.1.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-jdbc< / artifactId>
< version> 3.1.1.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-orm< / artifactId>
< version> 3.1.1.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-acl< / artifactId>
< version> 3.1.0.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-mock< / artifactId>
< version> 2.0.8< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-test< / artifactId>
< version> 3.1.1.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework.security< / groupId>
< artifactId> facelets-taglib-jsf20-spring-3< / artifactId>
< version> 0.5< / version>
< / dependency>

<! - JCR - >
<依赖关系>
< groupId> org.apache.jackrabbit< / groupId>
< artifactId> jackrabbit-core< / artifactId>
< version> 2.4.1< / version>
<排除>
< exclude>
< artifactId> lucene-core< / artifactId>
< groupId> org.apache.lucene< / groupId>
< / exclusion>
< / exclusions>
< / dependency>
<依赖关系>
< groupId> javax.jcr< / groupId>
< artifactId> jcr< / artifactId>
< version> 2.0< / version>
< / dependency>

<! - HIBERNATE - >
<依赖关系>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-core< / artifactId>
< version> 4.1.1.Final< / version>
< / dependency>
<依赖关系>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-validator< / artifactId>
< version> 4.1.0.Final< / version>
< / dependency>
<依赖关系>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-search< / artifactId>
< version> 4.1.0.CR3< / version>
<排除>
< exclude>
< artifactId> lucene-core< / artifactId>
< groupId> org.apache.lucene< / groupId>
< / exclusion>
< exclude>
< artifactId> commons-lang< / artifactId>
< groupId> commons-lang< / groupId>
< / exclusion>
< / exclusions>
< / dependency>

<! - J2EE - >


<依赖关系>
< groupId> org.jboss.spec< / groupId>
< artifactId> jboss-javaee-6.0< / artifactId>
< version> 1.0.0.Final< / version>
< type> pom< / type>
< scope>已提供< / scope>
< / dependency>


<依赖关系>
< groupId> javax< / groupId>
< artifactId> javaee-web-api< / artifactId>
< version> 6.0< / version>
< scope>已提供< / scope>
< / dependency>

<依赖关系>
< groupId> org.apache.myfaces.orchestra< / groupId>
< artifactId> myfaces-orchestra-core< / artifactId>
< version> 1.4< / version>
<排除>
< exclude>
< artifactId> commons-lang< / artifactId>
< groupId> commons-lang< / groupId>
< / exclusion>
< / exclusions>
< / dependency>

< / dependencies>



.classpath

 <?xml version =1.0encoding =UTF-8?> 
< classpath>
< classpathentry exclud =de / lyth / user / handler / ChatRoomBean.java | de / lyth / user / handler / ChatUserHandler.javakind =srcpath =src/>
< classpathentry kind =conpath =org.eclipse.jdt.launching.JRE_CONTAINER / org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType / J2SE-1.5/>
< classpathentry kind =conpath =org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER>
<属性>
< attribute name =org.eclipse.jst.component.dependencyvalue =/ WEB-INF / lib/>
< / attributes>
< / classpathentry>
< classpathentry kind =conpath =org.eclipse.jst.j2ee.internal.web.container/>
< classpathentry kind =conpath =org.eclipse.jst.j2ee.internal.module.container/>
< classpathentry kind =outputpath =target / classes/>



我如何告诉m2eclipse当我运行测试时,应该包括jboss-javaee-6.0,并且在服务器上运行时不应该

解决方案

m2e-wtp,Maven Integration for Eclipse WTP( https://github.com/sonatype/m2eclipse- wtp / wiki )。



eclipse更新站点可在 http://download.jboss.org/jbosstools/updates/m2eclipse-wtp/



一旦安装,它将确保提供的和测试依赖性未部署到您的服务器(您可以先运行Maven>更新项目配置)


Hi i try to write a pomfile wich supports running unittests + running on server in eclipse. But m2eclipse ignores the scopes and always deployes everything to the server.

either i get

java.lang.NoClassDefFoundError: javax/servlet/jsp/el/ELException

because i've not included the "javaee-web-api" with code or i get

Caused by: java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, com/sun/faces/config/ConfigureListener, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type avax/el/ExpressionFactory; used in the signature

because ive included them with code but tomcat7 includes them too, so i tried to add "provided":

    <dependency>
        <groupId>org.jboss.spec</groupId>
        <artifactId>jboss-javaee-6.0</artifactId>
        <version>1.0.0.Final</version>
        <type>pom</type>
        <scope>provided</scope>
    </dependency>

But when i run it on server from eclipse anyway the jars are included on classpath.

POM.XML

<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Lythgmbh</groupId>
<artifactId>Sociato</artifactId>
<version>0.0.1-SNAPSHOT</version>
<repositories>
    <repository>
        <id>central</id>
        <name>Maven Repository Switchboard</name>
        <url>http://repo1.maven.org/maven2</url>
        <layout>default</layout>
    </repository>
    <repository>
        <id>central2</id>
        <name>Maven Repository Switchboard2</name>
        <url>http://repo2.maven.org/maven2</url>
        <layout>default</layout>
    </repository>
    <repository>
        <id>prime-repo</id>
        <name>PrimeFaces Maven Repository</name>
        <url>http://repository.primefaces.org</url>
        <layout>default</layout>
    </repository>
    <repository>
        <id>fuse-repo</id>
        <name>Fuse open source community</name>
        <url>http://repo.fusesource.com/maven2</url>
        <layout>default</layout>
    </repository>
    <repository>
        <id>jahia.org</id>
        <name>jahia.org</name>
        <url>http://maven.jahia.org/maven2</url>
        <layout>default</layout>
    </repository>
    <repository>
        <id>asf-snapshot</id>
        <name>ASF Maven Repository</name>
        <layout>default</layout>
        <url>http://people.apache.org/maven-snapshot-repository</url>
    </repository>
    <repository>
        <id>org.springframework.security.taglibs.facelets</id>
        <url>http://spring-security-facelets-taglib.googlecode.com/svn/repo/</url>
    </repository>
    <repository>
        <id>repository.jboss.org-public</id>
        <name>JBoss repository</name>
        <url>https://repository.jboss.org/nexus/content/groups/public</url>
    </repository>
</repositories>
<dependencies>

    <!-- ADDITIONAL -->
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.1</version>
    </dependency>
    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
        <version>2.2.2</version>
    </dependency>
    <dependency>
        <groupId>postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>9.1-901-1.jdbc4</version>
    </dependency>
    <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
        <version>3.1</version>
    </dependency>
    <dependency>
        <groupId>jfree</groupId>
        <artifactId>jfreechart</artifactId>
        <version>1.0.13</version>
    </dependency>
    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20090211</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
        <type>jar</type>
        <scope>compile</scope>
        <exclusions>
            <exclusion>
                <groupId>com.sun.jmx</groupId>
                <artifactId>jmxri</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.sun.jdmk</groupId>
                <artifactId>jmxtools</artifactId>
            </exclusion>
            <exclusion>
                <groupId>javax.jms</groupId>
                <artifactId>jms</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>net.htmlparser.jericho</groupId>
        <artifactId>jericho-html</artifactId>
        <version>3.2</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
    </dependency>
    <dependency>
        <groupId>org.supercsv</groupId>
        <artifactId>supercsv</artifactId>
        <version>1.20</version>
    </dependency>
    <dependency>
        <groupId>com.octo.captcha</groupId>
        <artifactId>jcaptcha</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium</artifactId>
        <version>2.0rc2</version>
        <type>pom</type>
        <exclusions>
            <exclusion>
                <artifactId>httpclient</artifactId>
                <groupId>org.apache.httpcomponents</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.openid4java</groupId>
        <artifactId>openid4java-consumer</artifactId>
        <version>0.9.6</version>
        <type>pom</type>
    </dependency>
    <dependency>
        <groupId>com.lowagie</groupId>
        <artifactId>itext</artifactId>
        <version>2.1.7</version>
    </dependency>
    <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz</artifactId>
        <version>1.8.6</version>
    </dependency>
    <dependency>
        <groupId>net.sf.ehcache</groupId>
        <artifactId>ehcache</artifactId>
        <version>2.5.1</version>
        <type>pom</type>
    </dependency>
    <dependency>
        <groupId>com.sun.mail</groupId>
        <artifactId>javax.mail</artifactId>
        <version>1.4.5</version>
    </dependency>
    <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-core</artifactId>
        <version>3.3.0</version>
    </dependency>

    <!-- JSF -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>2.1.7</version>
    </dependency>
    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>2.1.7</version>
    </dependency>
    <dependency>
        <groupId>org.richfaces.ui</groupId>
        <artifactId>richfaces-components-api</artifactId>
        <version>4.2.0.Final</version>
    </dependency>
    <dependency>
        <groupId>org.richfaces.core</groupId>
        <artifactId>richfaces-core-api</artifactId>
        <version>4.2.0.Final</version>
    </dependency>
    <dependency>
        <groupId>org.primefaces</groupId>
        <artifactId>primefaces</artifactId>
        <version>3.2</version>
    </dependency>
    <dependency>
        <groupId>commons-el</groupId>
        <artifactId>commons-el</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>org.richfaces.ui</groupId>
        <artifactId>richfaces-components-ui</artifactId>
        <version>4.2.0.Final</version>
    </dependency>
    <dependency>
        <groupId>org.richfaces.core</groupId>
        <artifactId>richfaces-core-impl</artifactId>
        <version>4.2.0.Final</version>
    </dependency>

    <!-- SPRING -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.1.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.1.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-taglibs</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>3.1.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>3.1.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>3.1.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>3.1.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>3.1.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>3.1.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-acl</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-mock</artifactId>
        <version>2.0.8</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>3.1.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>facelets-taglib-jsf20-spring-3</artifactId>
        <version>0.5</version>
    </dependency>

    <!-- JCR -->
    <dependency>
        <groupId>org.apache.jackrabbit</groupId>
        <artifactId>jackrabbit-core</artifactId>
        <version>2.4.1</version>
        <exclusions>
            <exclusion>
                <artifactId>lucene-core</artifactId>
                <groupId>org.apache.lucene</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>javax.jcr</groupId>
        <artifactId>jcr</artifactId>
        <version>2.0</version>
    </dependency>

    <!-- HIBERNATE -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>4.1.1.Final</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>4.1.0.Final</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-search</artifactId>
        <version>4.1.0.CR3</version>
        <exclusions>
            <exclusion>
                <artifactId>lucene-core</artifactId>
                <groupId>org.apache.lucene</groupId>
            </exclusion>
            <exclusion>
                <artifactId>commons-lang</artifactId>
                <groupId>commons-lang</groupId>
            </exclusion>
        </exclusions>
    </dependency>

    <!-- J2EE -->


    <dependency>
        <groupId>org.jboss.spec</groupId>
        <artifactId>jboss-javaee-6.0</artifactId>
        <version>1.0.0.Final</version>
        <type>pom</type>
        <scope>provided</scope>
    </dependency>


    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>6.0</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.myfaces.orchestra</groupId>
        <artifactId>myfaces-orchestra-core</artifactId>
        <version>1.4</version>
        <exclusions>
            <exclusion>
                <artifactId>commons-lang</artifactId>
                <groupId>commons-lang</groupId>
            </exclusion>
        </exclusions>
    </dependency>

</dependencies>

.classpath

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="de/lyth/user/handler/ChatRoomBean.java|de/lyth/user/handler/ChatUserHandler.java" kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
    <attributes>
        <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
    </attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="output" path="target/classes"/>

How can i tell m2eclipse that when i run tests it should include "jboss-javaee-6.0" and when running on server it should not

解决方案

You must install m2e-wtp, the Maven Integration for Eclipse WTP ( https://github.com/sonatype/m2eclipse-wtp/wiki).

The eclipse update site is available at http://download.jboss.org/jbosstools/updates/m2eclipse-wtp/

Once installed, it'll make sure the provided and test dependencies are not deployed to your server (you might run "Maven > Update Project Configuration" first)

这篇关于方法中的Absent Code属性在类文件javax / persistence / InheritanceType中不是本机或抽象的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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