1

クエリビルダーを作成する必要があります。ejbサイトで作成したいと思います。そのためには、org.primefaces.model.SortOrder を使用する必要があります。ejb POM の primefaces に依存関係を追加します。その後、 「java.lang.NoClassDefFoundError: org/primefaces/model/SortOrder」を取得しました。この依存関係は戦争でうまく機能します。何か案は?

Pom WAR ビルド部分

<build>
<plugins>
        <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>
        </configuration>
    </plugin>

</plugins>
<finalName>JSF</finalName> 
</build>



EJB Pom


<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>test.com</groupId>
    <artifactId>EJB</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>ejb</packaging>

    <name>EJB</name>

    <properties>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
My dependencies with primefaces
</dependencies>
<build>
<plugins>
<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>
    <compilerArguments>
        <endorseddirs>${endorsed.dir}</endorseddirs>
    </compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
    <ejbVersion>3.1</ejbVersion>

    <archive>
        <manifestEntries>
            <Dependencies>org.slf4j</Dependencies>
        </manifestEntries>
    </archive>

</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
    <execution>
        <phase>validate</phase>
        <goals>
            <goal>copy</goal>
        </goals>
        <configuration>
            <outputDirectory>${endorsed.dir}</outputDirectory>
            <silent>true</silent>
            <artifactItems>
                <artifactItem>
                    <groupId>javax</groupId>
                    <artifactId>javaee-endorsed-api</artifactId>
                    <version>6.0</version>
                    <type>jar</type>
                </artifactItem>
            </artifactItems>
        </configuration>
    </execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings 
    only. It has no influence on the Maven build itself. -->
<plugin>
    <groupId>org.eclipse.m2e</groupId>
    <artifactId>lifecycle-mapping</artifactId>
    <version>1.0.0</version>
    <configuration>
        <lifecycleMappingMetadata>
            <pluginExecutions>
                <pluginExecution>
                    <pluginExecutionFilter>
                        <groupId>
                            org.apache.maven.plugins
                        </groupId>
                        <artifactId>
                            maven-dependency-plugin
                        </artifactId>
                        <versionRange>
                            [2.1,)
                        </versionRange>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                    </pluginExecutionFilter>
                    <action>
                        <ignore></ignore>
                    </action>
                </pluginExecution>
            </pluginExecutions>
        </lifecycleMappingMetadata>
    </configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>


EAR is not a maven projekt


  <display-name>EAR</display-name>
  <module>
    <web>
      <web-uri>JSF.war</web-uri>
      <context-root>JSF</context-root>
    </web>
  </module>
  <module>
    <ejb>EJB.jar</ejb>
  </module>
</application>
4

1 に答える 1

2

ejb と war を同時に使用するアプリケーションが必要な場合は、ライブラリを含む ear パッケージを作成する必要があります。3 番目の pom を作成したくない (2 人の子供から ear を作成する) 場合は、このライブラリをサーバーに移動できます。

于 2013-04-04T13:36:48.397 に答える