java - Maven 生成源 "Some problems were encountered while building the effective model for "

标签 java maven

我不明白,有时有效有时无效...... 我正在尝试使用生成源目标,但收到此消息:

[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 和 clean,但它不起作用。

最佳答案

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

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

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

关于java - Maven 生成源 "Some problems were encountered while building the effective model for ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52709247/

相关文章:

java - setLocation() 并不总是适用于没有布局管理器的面板内的 JLabel 对象,这是一个错误吗?

java - 是否有 JAXB 注释可以执行此操作?

java - 记录之间的数据交换非常慢

java - 为什么 Maven 抛出类似 `must be "pom"的错误,但实际上是 "jar"`?

java - javax javaee-api 6.0 的 Maven 源代码

java.lang.OutOfMemory错误: Java heap space

java - 注册。作业级别的 spring 批处理作业的事务支持

java - 尝试通过 Intellij IDEA 部署 tomcat 服务器并出现奇怪的 missing server.xml 错误

maven - 将 JIRA 集成到 Maven : which URL?

maven - 在没有 Maven 的情况下构建 Maven 项目