jdk1.6升级jdk1.8 mvn 编译报错:错误: @param name 未找到

本文解决Java开发中遇到的注释语法错误问题,通过调整pom.xml文件配置,包括maven-compiler-plugin和maven-javadoc-plugin插件的具体设置,以确保Javadoc能正确解析。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

报错如下:

D:\******.java:32: 错误: @param name 未找到
         * @param ordbankId
           ^
D:\******.java:121: 错误: @return 的用法无效
     * @return
       ^   

pom.xml配置需要加上如下红色部分:
        <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>

                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-source-plugin</artifactId>
                                <version>2.1.2</version>
                                <executions>
                                        <execution>
                                                <phase>package</phase>
                                                <goals>
                                                        <goal>jar</goal>
                                                </goals>
                                        </execution>
                                </executions>
                        </plugin>

                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-javadoc-plugin</artifactId>
                                <version>2.7</version>
                                <configuration>
                                  <aggregate>true</aggregate>
                                  <encoding>UTF-8</encoding>
                          </configuration> 
                    <executions>  
                         <execution>  
                            <id>attach-javadocs</id>  
                            <goals>  
                                <goal>jar</goal>  
                            </goals>  
                            <configuration> 
                      <additionalparam>-Xdoclint:none</additionalparam> 
                   </configuration> 

                        </execution>  
                    </executions>
                        </plugin>
                </plugins>
                <resources>
                        <resource>
                                <directory>src/main/resources</directory>
                                <filtering>true</filtering>
                                <includes>
                                        <include>**/*.*</include>
                                </includes>
                        </resource>
                </resources>
        </build>

D:\JDK\JDK1.8\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-Dmanagement.endpoints.jmx.exposure.include=*" "-javaagent:D:\IDEA\IntelliJ IDEA 2024.1\lib\idea_rt.jar=53579:D:\IDEA\IntelliJ IDEA 2024.1\bin" -Dfile.encoding=UTF-8 -classpath "D:\JDK\JDK1.8\jre\lib\charsets.jar;D:\JDK\JDK1.8\jre\lib\ext\access-bridge-64.jar;D:\JDK\JDK1.8\jre\lib\ext\cldrdata.jar;D:\JDK\JDK1.8\jre\lib\ext\dnsns.jar;D:\JDK\JDK1.8\jre\lib\ext\jaccess.jar;D:\JDK\JDK1.8\jre\lib\ext\jfxrt.jar;D:\JDK\JDK1.8\jre\lib\ext\localedata.jar;D:\JDK\JDK1.8\jre\lib\ext\nashorn.jar;D:\JDK\JDK1.8\jre\lib\ext\sunec.jar;D:\JDK\JDK1.8\jre\lib\ext\sunjce_provider.jar;D:\JDK\JDK1.8\jre\lib\ext\sunmscapi.jar;D:\JDK\JDK1.8\jre\lib\ext\sunpkcs11.jar;D:\JDK\JDK1.8\jre\lib\ext\zipfs.jar;D:\JDK\JDK1.8\jre\lib\jce.jar;D:\JDK\JDK1.8\jre\lib\jfr.jar;D:\JDK\JDK1.8\jre\lib\jfxswt.jar;D:\JDK\JDK1.8\jre\lib\jsse.jar;D:\JDK\JDK1.8\jre\lib\management-agent.jar;D:\JDK\JDK1.8\jre\lib\resources.jar;D:\JDK\JDK1.8\jre\lib\rt.jar;D:\idea-temp\AI-Leader\ruoyi-modules\ruoyi-ai\target\classes;D:\Apache Maven\respository_new\org\slf4j\slf4j-reload4j\1.7.36\slf4j-reload4j-1.7.36.jar;D:\Apache Maven\respository_new\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;D:\Apache Maven\respository_new\ch\qos\reload4j\reload4j\1.2.19\reload4j-1.2.19.jar;D:\Apache Maven\respository_new\org\java-websocket\Java-WebSocket\1.5.1\Java-WebSocket-1.5.1.jar;D:\Apache Maven\respository_new\com\fasterxml\jackson\core\jackson-databind\2.13.5\jackson-databind-2.13.5.jar;D:\Apache Maven\respository_new\com\fasterxml\jackson\core\jackson-annotations\2.13.5\jackson-annotations-2.13.5.jar;D:\Apache Maven\respository_new\com\fasterxml\jackson\core\jackson-core\2.13.5\jackson-core-2.13.5.jar;D:\Apache Maven\respository_new\com\squareup\okhttp3\okhttp\4.9.3\okhttp-4.9.3.jar;D:\Apache Maven\respositor
06-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值