Maven生成源“在构建有效的模型时遇到了一些问题”

时间:2018-10-08 19:56:28

标签: java maven

我不明白,有时它有用,有时不.... 我正在尝试使用generate-sources目标,但是我收到了以下消息:

[WARNING] Some problems were encountered while building the effective model for SoapClientSd:SoapClientSd:jar:0.0.2
[WARNING] Reporting configuration should be done in <reporting> section, not in maven-site-plugin <configuration> as reportPlugins parameter. @ line 139, column 20
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[INFO] ---------------------< SoapClientSd:SoapClientSd >-------------------
[INFO] Building SoapClientSd 0.0.2
[INFO] --------------------------------[ jar ]------------------------------
[INFO] BUILD SUCCESS
[INFO] Total time: 0.250 s
[INFO] Finished at: 2018-10-08T21:46:21+02:00

这是我的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>SoapClientSd</groupId>
    <artifactId>SoapClientSd</artifactId>
    <version>0.0.2</version>

    <packaging>jar</packaging>
    <name>${project.artifactId}</name>

    <properties>
        <jdk.source>1.7</jdk.source>
        <jdk.target>1.7</jdk.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <wsdl>http://localhost:8080/SoapSd/UniboServices?wsdl</wsdl>
        <ws.stub.package.name>it.unibo.test.services</ws.stub.package.name>
        <log4j.version>1.2.17</log4j.version>
        <commons-io.version>2.4</commons-io.version>
        <commons-logging.version>1.2</commons-logging.version>
        <cxf.version>2.5.2</cxf.version>
        <maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
        <maven-source-plugin.version>3.0.0</maven-source-plugin.version>
        <maven-compiler-plugin.version>3.6.1</maven-compiler-plugin.version>
    </properties> 

    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <pluginManagement>
        <plugins>

            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <version>${cxf.version}</version>
                <executions>

                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                        <configuration>
                            <tasks>
                            </tasks>
                            <sourceRoot>target/generated-sources</sourceRoot>
                            <wsdlOptions>
                                <wsdlOption>
                                    <wsdl>${wsdl}</wsdl>
                                    <extraargs>
                                        <extraarg>-verbose</extraarg>
                                        <extraarg>-client</extraarg>
                                        <extraarg>-frontend</extraarg>
                                        <extraarg>jaxws21</extraarg>
                                        <extraarg>-p</extraarg>
                                        <extraarg>${ws.stub.package.name}</extraarg>
                                    </extraargs>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>${jdk.source}</source>
                    <target>${jdk.target}</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <additionalparam>${javadoc.opts}</additionalparam>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <reportPlugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-javadoc-plugin</artifactId>
                            <configuration>
                                <additionalparam>${javadoc.opts}</additionalparam>
                            </configuration>
                        </plugin>
                    </reportPlugins>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-bundle</artifactId>
            <version>${cxf.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j.version}</version>
        </dependency>
    </dependencies>
</project>

我在做什么错?为什么会出现此错误?一段时间后,我只是再次运行“生成的源”,这是行不通的。我也尝试使用-X并进行清理,但这不起作用。

1 个答案:

答案 0 :(得分:-1)

要生成源,必须启动您的应用程序。

检查您是否可以访问http://localhost:8080/SoapSd/UniboServices?wsdl

尝试关闭所有目​​标/生成源文件夹