Minecraft_652
废话不多说直接上报错


代码位置选中的第70行的报错


显然这个问题不是我写错了,而是低版本的兼容问题
插件在1.16的版本上并没有此bug
我从网上搜了一下都说是guava的问题,要更新guava版本
但是我的guava已经是最新的了



克鲁鲁殿下
本帖最后由 克鲁鲁殿下 于 2022-3-22 12:16 编辑

有没有一种可能,1.8.8这种六七年前的服务端,不支持最新版的guava,反而需要老一点的版本。。。。
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3.   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  4.   <modelVersion>4.0.0</modelVersion>
  5.   <parent>
  6.     <groupId>com.google.guava</groupId>
  7.     <artifactId>guava-parent</artifactId>
  8.     <version>17.0</version>
  9.   </parent>
  10.   <artifactId>guava</artifactId>
  11.   <name>Guava: Google Core Libraries for Java</name>
  12.   <packaging>bundle</packaging>
  13.   <description>
  14.     Guava is a suite of core and expanded libraries that include
  15.     utility classes, google's collections, io classes, and much
  16.     much more.

  17.     Guava has only one code dependency - javax.annotation,
  18.     per the JSR-305 spec.
  19.   </description>
  20.   <dependencies>
  21.     <dependency>
  22.       <groupId>com.google.code.findbugs</groupId>
  23.       <artifactId>jsr305</artifactId>
  24.       <optional>true</optional><!-- needed only for annotations -->
  25.     </dependency>
  26.     <!-- TODO(cpovirk): want this only for dependency plugin but seems not to work there? Maven runs without failure, but the resulting Javadoc is missing the hoped-for inherited text -->
  27.   </dependencies>
  28.   <build>
  29.     <plugins>
  30.       <plugin>
  31.         <groupId>org.apache.felix</groupId>
  32.         <artifactId>maven-bundle-plugin</artifactId>
  33.         <version>2.3.7</version>
  34.         <extensions>true</extensions>
  35.         <executions>
  36.           <execution>
  37.             <id>bundle-manifest</id>
  38.             <phase>process-classes</phase>
  39.             <goals>
  40.               <goal>manifest</goal>
  41.             </goals>
  42.           </execution>
  43.         </executions>
  44.         <configuration>
  45.           <instructions>
  46.             <Export-Package>!com.google.common.base.internal,com.google.common.*</Export-Package>
  47.             <Import-Package>
  48.               javax.annotation;resolution:=optional,
  49.               javax.inject;resolution:=optional,
  50.               sun.misc.*;resolution:=optional
  51.             </Import-Package>
  52.           </instructions>
  53.         </configuration>
  54.       </plugin>
  55.       <plugin>
  56.         <artifactId>maven-compiler-plugin</artifactId>
  57.       </plugin>
  58.       <plugin>
  59.         <artifactId>maven-source-plugin</artifactId>
  60.       </plugin>
  61.       <!-- TODO(cpovirk): include JDK sources when building testlib doc, too -->
  62.       <plugin>
  63.         <artifactId>maven-dependency-plugin</artifactId>
  64.         <executions>
  65.           <execution>
  66.             <id>unpack-jdk-sources</id>
  67.             <phase>site</phase>
  68.             <goals><goal>unpack-dependencies</goal></goals>
  69.             <configuration>
  70.               <includeArtifactIds>srczip</includeArtifactIds>
  71.               <overWrite>true</overWrite>
  72.               <outputDirectory>${project.build.directory}/jdk-sources</outputDirectory>
  73.               <silent>false</silent>
  74.             </configuration>
  75.           </execution>
  76.         </executions>
  77.       </plugin>
  78.       <plugin>
  79.         <groupId>org.codehaus.mojo</groupId>
  80.         <artifactId>animal-sniffer-maven-plugin</artifactId>
  81.       </plugin>
  82.       <plugin>
  83.         <groupId>org.apache.maven.plugins</groupId>
  84.         <artifactId>maven-javadoc-plugin</artifactId>
  85.         <configuration>
  86.           <encoding>UTF-8</encoding>
  87.           <docencoding>UTF-8</docencoding>
  88.           <charset>UTF-8</charset>
  89.           <additionalparam>-XDignore.symbol.file</additionalparam>
  90.           <excludePackageNames>com.google.common.base.internal</excludePackageNames>
  91.           <linksource>true</linksource>
  92.           <links>
  93.             <link>http://jsr-305.googlecode.com/svn/trunk/javadoc</link>
  94.             <link>http://docs.oracle.com/javase/7/docs/api/</link>
  95.           </links>
  96.           <!-- TODO(cpovirk): can we use includeDependencySources and a local com.oracle.java:jdk-lib:noversion:sources instead of all this unzipping and manual sourcepath modification? -->
  97.           <sourcepath>${project.build.sourceDirectory}:${project.build.directory}/jdk-sources</sourcepath>
  98.           <subpackages>com.google.common</subpackages>
  99.         </configuration>
  100.         <executions>
  101.           <execution>
  102.             <id>attach-docs</id>
  103.           </execution>
  104.           <execution>
  105.             <id>generate-javadoc-site-report</id>
  106.             <phase>site</phase>
  107.             <goals><goal>javadoc</goal></goals>
  108.           </execution>
  109.           <execution>
  110.             <id>generate-jdiff-site-report</id>
  111.             <phase>site</phase>
  112.             <goals><goal>javadoc</goal></goals>
  113.             <configuration>
  114.               <doclet>jdiff.JDiff</doclet>
  115.               <docletPath>${project.basedir}/lib/jdiff.jar</docletPath>
  116.               <additionalparam>
  117.                 -XDignore.symbol.file -apiname 'Guava ${project.version}'
  118.               </additionalparam>
  119.               <useStandardDocletOptions>false</useStandardDocletOptions>
  120.               <reportOutputDirectory>${project.reporting.outputDirectory}</reportOutputDirectory>
  121.               <destDir>jdiff</destDir>
  122.             </configuration>
  123.           </execution>
  124.         </executions>
  125.       </plugin>
  126.     </plugins>
  127.   </build>
  128.   <profiles>
  129.     <profile>
  130.       <id>srczip</id>
  131.       <activation>
  132.         <file>
  133.           <exists>${java.home}/../src.zip</exists>
  134.         </file>
  135.       </activation>
  136.       <dependencies>
  137.         <dependency>
  138.           <groupId>jdk</groupId>
  139.           <artifactId>srczip</artifactId>
  140.           <version>999</version>
  141.           <scope>system</scope>
  142.           <systemPath>${java.home}/../src.zip</systemPath>
  143.           <optional>true</optional>
  144.         </dependency>
  145.       </dependencies>
  146.     </profile>
  147.   </profiles>
  148. </project>
复制代码

1.8.8服务端中有关guava的xml文件


也许你要用17.0这种版本()
  1. #Generated by org.apache.felix.bundleplugin
  2. #Tue Apr 22 16:47:33 EDT 2014
  3. version=17.0
  4. groupId=com.google.guava
  5. artifactId=guava
复制代码
pom.properties文件

Minecraft_652
克鲁鲁殿下 发表于 2022-3-22 12:15
有没有一种可能,1.8.8这种六七年前的服务端,不支持最新版的guava,反而需要老一点的版本。。。。

1.8.8 ...

好的我试一下

Minecraft_652
克鲁鲁殿下 发表于 2022-3-22 12:15
有没有一种可能,1.8.8这种六七年前的服务端,不支持最新版的guava,反而需要老一点的版本。。。。

1.8.8 ...


不行

WekyJay
如果是第三方包,是否考虑了一起打包?(我的拙见,不代表说的正确)

Minecraft_652
WekyJay 发表于 2022-3-22 12:38
如果是第三方包,是否考虑了一起打包?(我的拙见,不代表说的正确)

用的是maven里头写的depend
我觉得应该是没有问题的,因为在高版本没有这个问题

LOVELY蕾姆酱
有没有一种可能,我看不懂()

第一页 上一页 下一页 最后一页