0

我正在开发一个在后端使用 flex 和 Java 的项目。这是一个网络应用程序项目。问题是当我通过 Eclipse 编译它时它很好。但是当我使用 maven 构建战争时,我的WEB-INF\classes文件夹中没有类文件。如果有人遇到过这样的问题,我没有收到任何错误,但仍然没有类文件。

我在这里附上了我的 POM 文件

<?xml version="1.0" ?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.abc.def</groupId>
    <artifactId>abc-cde</artifactId>
    <version>0.1</version>
    <packaging>war</packaging>

    <name>abc-cde</name>

    <build>
        <sourceDirectory>src/clv_web_flex/Mxmls</sourceDirectory>
        <plugins>
            <plugin>
                <!-- Plugin runs on Maven version 3.0.3 and so on -->
                <groupId>org.sonatype.flexmojos</groupId>
                <artifactId>flexmojos-maven-plugin</artifactId>
                <version>4.2-beta</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>copy-flex-resources</goal>
                        </goals>
                        <configuration>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <!-- Excludes jar file in WAR -->
                    <packagingIncludes>WEB-INF/lib/*.jar</packagingIncludes>
                    <webResources>
                        <resource>
                            <!-- this is relative to the pom.xml directory -->
                            <directory>WebContent</directory>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.adobe.flexunit</groupId>
            <artifactId>flexunit</artifactId>
            <version>0.85</version>
            <type>swc</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.adobe.flex.framework</groupId>
            <artifactId>flex-framework</artifactId>
            <version>4.5.1.21328</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>org.springframework.flex</groupId>
            <artifactId>spring-flex-core</artifactId>
            <version>1.5.2.RELEASE</version>
        </dependency> 
        <dependency>
            <groupId>com.adobe.blazeds</groupId>
            <artifactId>blazeds-common</artifactId>
            <version>3.2.0.3978</version>
        </dependency>
        <dependency>
            <groupId>com.adobe.blazeds</groupId>
            <artifactId>blazeds-core</artifactId>
            <version>3.2.0.3978</version>
        </dependency>
        <dependency>
            <groupId>com.adobe.blazeds</groupId>
            <artifactId>blazeds-proxy</artifactId>
            <version>3.2.0.3978</version>
        </dependency>
        <dependency>
            <groupId>com.adobe.blazeds</groupId>
            <artifactId>blazeds-remoting</artifactId>
            <version>3.2.0.3978</version>
        </dependency>
        <dependency>
            <groupId>com.adobe.blazeds</groupId>
            <artifactId>cfgatewayadapter</artifactId>
            <version>0.020108</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.16</version>
        </dependency>
        <dependency>
            <groupId>com.adobe.blazeds</groupId>
            <artifactId>flex-messaging-common</artifactId>
            <version>4.0.0.14931</version>
        </dependency>
        <dependency>
            <groupId>com.adobe.blazeds</groupId>
            <artifactId>flex-messaging-core</artifactId>
            <version>4.0.0.14931</version>
        </dependency>
        <dependency>
            <groupId>com.adobe.blazeds</groupId>
            <artifactId>flex-messaging-opt</artifactId>
            <version>4.0.0.14931</version>
        </dependency>
        <dependency>
            <groupId>com.adobe.blazeds</groupId>
            <artifactId>flex-messaging-proxy</artifactId>
            <version>4.0.0.14931</version>
        </dependency>
        <dependency>
            <groupId>com.adobe.blazeds</groupId>
            <artifactId>flex-messaging-remoting</artifactId>
            <version>4.0.0.14931</version>
        </dependency>
        <dependency>
            <groupId>com.adobe.blazeds</groupId>
            <artifactId>flex-rds-server</artifactId>
            <version>272564</version>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.5</version>
        </dependency>
        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>1.1.2</version>
        </dependency>
        <dependency>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
            <version>2.4.1</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>spring-external</id>
            <name>Spring External Repository</name>
            <url>http://maven.springframework.org/external</url>
        </repository>
        <repository>
            <id>flex-mojos-repository</id>
            <url>http://repository.sonatype.org/content/groups/flexgroup</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>flex-mojos-plugin-repository</id>
            <url>http://repository.sonatype.org/content/groups/flexgroup</url>
        </pluginRepository>
    </pluginRepositories>
</project>

我运行mvn install插件。提前致谢!

4

1 回答 1

0

如果您尝试删除 JAR 文件而不删除其他文件,则应替换<packagingIncludes>WEB-INF/lib/*.jar</packagingIncludes><packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>

于 2012-06-11T14:40:52.393 回答