xmlbeans-maven-plugin似乎要求使用jdk 1.4,而已提供更高版本的jdk。

huangapple go评论89阅读模式
英文:

Why does xmlbeans-maven-plugin seem to ask for jdk 1.4 went higher jdk is provided?

问题

我正在将一个旧的库迁移到Java 8(之后是11和17),但我在构建服务器上收到一个错误,说我正在使用Java 1.4(本地构建正常运行):

17:53:21  [INFO] --- xmlbeans-maven-plugin:2.3.3:xmlbeans (default) @ edoc-deeplink-intact-xml ---
17:53:29  warning: [options] bootstrap class path not set in conjunction with -source 1.4
17:53:29  error: Source option 1.4 is no longer supported. Use 6 or later.
17:53:29  error: Target option 1.4 is no longer supported. Use 1.6 or later.

然而,我的有效POM似乎是在Java 1.8上,所以我不明白为什么会收到这个错误。以下是有效POM:

<!-- ====================================================================== -->
<!--                                                                        -->
<!-- Effective POM for project                                              -->
<!--                                                                        -->
<!-- ====================================================================== -->

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>parent-poms</groupId>
    <artifactId>parent-pom</artifactId>
    <version>1.0.0</version>
  </parent>

  <groupId>common</groupId>
  <artifactId>my-xml-lib</artifactId>
  <version>1.0.0-SNAPSHOT</version>

  <properties>
    <java.version>1.8</java.version>
    <jdependMavenPluginVersion>2.0-beta-2</jdependMavenPluginVersion>
    <jdk>1.8</jdk>
    <jdk.arch>64</jdk.arch>
    <jdk.vendor>redhat</jdk.vendor>
    <jdk.version>1.8</jdk.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <mavenAntrunPluginVersion>1.7</mavenAntrunPluginVersion>
    <mavenCheckstylePluginVersion>2.10</mavenCheckstylePluginVersion>
    <mavenDeployPluginVersion>2.7</mavenDeployPluginVersion>
    <mavenEnforcerPluginVersion>1.2</mavenEnforcerPluginVersion>
    <mavenJavadocPluginVersion>2.9</mavenJavadocPluginVersion>
    <mavenJxrPluginVersion>2.3</mavenJxrPluginVersion>
    <mavenPluginPluginVersion>3.2</mavenPluginPluginVersion>
    <mavenPmdPluginVersion>3.0.1</mavenPmdPluginVersion>
    <mavenProjectInfoReportsPluginVersion>2.6</mavenProjectInfoReportsPluginVersion>
    <mavenSourcePluginVersion>2.2.1</mavenSourcePluginVersion>
    <mavenSurefirePluginVersion>2.15</mavenSurefirePluginVersion>
    <mavenSurefireReportPluginVersion>2.14.1</mavenSurefireReportPluginVersion>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <taglistMavenPluginVersion>2.4</taglistMavenPluginVersion>
    <timestamp>2023-05-29T21:46:36Z</timestamp>
    <versionsMavenPluginVersion>2.1</versionsMavenPluginVersion>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.xmlbeans</groupId>
      <artifactId>xmlbeans</artifactId>
      <version>3.1.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <id>central</id>
      <url>http://central</url>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <id>

<details>
<summary>英文:</summary>

I&#39;m migrating a old lib to java 8 (and after 11 and 17) and I&#39;m getting a error saying I&#39;m of java 1.4 on our build server (local build is working fine): 

17:53:21 [INFO] --- xmlbeans-maven-plugin:2.3.3:xmlbeans (default) @ edoc-deeplink-intact-xml ---
17:53:29 warning: [options] bootstrap class path not set in conjunction with -source 1.4
17:53:29 error: Source option 1.4 is no longer supported. Use 6 or later.
17:53:29 error: Target option 1.4 is no longer supported. Use 1.6 or later.


However my effective pom seem to be on java 1.8 so I don&#39;t understand why I&#39;m getting this error.
Here the effective pom: 

<!-- ====================================================================== -->
<!-- -->
<!-- Effective POM for project -->
<!-- -->
<!-- ====================================================================== -->

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;>
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>parent-poms</groupId>
<artifactId>parent-pom</artifactId>
<version>1.0.0</version>
</parent>

<groupId>common</groupId>
<artifactId>my-xml-lib</artifactId>
<version>1.0.0-SNAPSHOT</version>

<properties>
<java.version>1.8</java.version>
<jdependMavenPluginVersion>2.0-beta-2</jdependMavenPluginVersion>
<jdk>1.8</jdk>
<jdk.arch>64</jdk.arch>
<jdk.vendor>redhat</jdk.vendor>
<jdk.version>1.8</jdk.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<mavenAntrunPluginVersion>1.7</mavenAntrunPluginVersion>
<mavenCheckstylePluginVersion>2.10</mavenCheckstylePluginVersion>
<mavenDeployPluginVersion>2.7</mavenDeployPluginVersion>
<mavenEnforcerPluginVersion>1.2</mavenEnforcerPluginVersion>
<mavenJavadocPluginVersion>2.9</mavenJavadocPluginVersion>
<mavenJxrPluginVersion>2.3</mavenJxrPluginVersion>
<mavenPluginPluginVersion>3.2</mavenPluginPluginVersion>
<mavenPmdPluginVersion>3.0.1</mavenPmdPluginVersion>
<mavenProjectInfoReportsPluginVersion>2.6</mavenProjectInfoReportsPluginVersion>
<mavenSourcePluginVersion>2.2.1</mavenSourcePluginVersion>
<mavenSurefirePluginVersion>2.15</mavenSurefirePluginVersion>
<mavenSurefireReportPluginVersion>2.14.1</mavenSurefireReportPluginVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<taglistMavenPluginVersion>2.4</taglistMavenPluginVersion>
<timestamp>2023-05-29T21:46:36Z</timestamp>
<versionsMavenPluginVersion>2.1</versionsMavenPluginVersion>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>3.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>

<repositories>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>central</id>
<url>http://central</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>central</id>
<url>http://central</url>
</pluginRepository>
</pluginRepositories>

<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav-jackrabbit</artifactId>
<version>2.3</version>
</extension>
</extensions>

&lt;resources&gt;
&lt;resource&gt;
&lt;filtering&gt;true&lt;/filtering&gt;
&lt;directory&gt;C:\Data\my-xml-lib\src\main\resources&lt;/directory&gt;
&lt;/resource&gt;
&lt;/resources&gt;
&lt;pluginManagement&gt;
&lt;plugins&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
&lt;version&gt;2.15&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
&lt;version&gt;1.7&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
&lt;version&gt;2.4&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
&lt;version&gt;2.10&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
&lt;version&gt;2.5&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-install-plugin&lt;/artifactId&gt;
&lt;version&gt;2.4&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-release-plugin&lt;/artifactId&gt;
&lt;version&gt;2.4.1&lt;/version&gt;
&lt;configuration&gt;
&lt;pushChanges&gt;true&lt;/pushChanges&gt;
&lt;useEditMode&gt;false&lt;/useEditMode&gt;
&lt;useReleaseProfile&gt;true&lt;/useReleaseProfile&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-checkstyle-plugin&lt;/artifactId&gt;
&lt;version&gt;2.10&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-jxr-plugin&lt;/artifactId&gt;
&lt;version&gt;2.3&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-pmd-plugin&lt;/artifactId&gt;
&lt;version&gt;3.0.1&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-site-plugin&lt;/artifactId&gt;
&lt;version&gt;3.2&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
&lt;version&gt;3.1&lt;/version&gt;
&lt;configuration&gt;
&lt;source&gt;1.8&lt;/source&gt;
&lt;target&gt;1.8&lt;/target&gt;
&lt;encoding&gt;ISO-8859-1&lt;/encoding&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-ear-plugin&lt;/artifactId&gt;
&lt;version&gt;2.8&lt;/version&gt;
&lt;configuration&gt;
&lt;version&gt;6&lt;/version&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
&lt;version&gt;2.3&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-project-info-reports-plugin&lt;/artifactId&gt;
&lt;version&gt;2.6&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
&lt;artifactId&gt;findbugs-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;2.5.2&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
&lt;artifactId&gt;cobertura-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;2.5.2&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
&lt;artifactId&gt;jdepend-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;2.0-beta-2&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
&lt;artifactId&gt;taglist-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;2.4&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
&lt;artifactId&gt;build-helper-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;1.8&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
&lt;artifactId&gt;versions-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;2.1&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.eclipse.m2e&lt;/groupId&gt;
&lt;artifactId&gt;lifecycle-mapping&lt;/artifactId&gt;
&lt;version&gt;1.0.0&lt;/version&gt;
&lt;configuration&gt;
&lt;lifecycleMappingMetadata&gt;
&lt;pluginExecutions&gt;
&lt;pluginExecution&gt;
&lt;pluginExecutionFilter&gt;
&lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
&lt;artifactId&gt;xmlbeans-maven-plugin&lt;/artifactId&gt;
&lt;versionRange&gt;[2.3.3,)&lt;/versionRange&gt;
&lt;goals&gt;
&lt;goal&gt;xmlbeans&lt;/goal&gt;
&lt;goal&gt;xmlbeans-test&lt;/goal&gt;
&lt;/goals&gt;
&lt;/pluginExecutionFilter&gt;
&lt;action&gt;
&lt;ignore /&gt;
&lt;/action&gt;
&lt;/pluginExecution&gt;
&lt;/pluginExecutions&gt;
&lt;/lifecycleMappingMetadata&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-source-plugin&lt;/artifactId&gt;
&lt;version&gt;2.2.1&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;attach-sources&lt;/id&gt;
&lt;goals&gt;
&lt;goal&gt;jar-no-fork&lt;/goal&gt;
&lt;/goals&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;inherited&gt;true&lt;/inherited&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
&lt;version&gt;2.9&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;attach-javadocs&lt;/id&gt;
&lt;goals&gt;
&lt;goal&gt;jar&lt;/goal&gt;
&lt;/goals&gt;
&lt;configuration&gt;
&lt;quiet&gt;true&lt;/quiet&gt;
&lt;/configuration&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;configuration&gt;
&lt;quiet&gt;true&lt;/quiet&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
&lt;version&gt;2.7&lt;/version&gt;
&lt;configuration&gt;
&lt;updateReleaseInfo&gt;true&lt;/updateReleaseInfo&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
&lt;version&gt;2.4&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
&lt;artifactId&gt;aspectj-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;1.5&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;groupId&gt;com.google.code.echo-maven-plugin&lt;/groupId&gt;
&lt;artifactId&gt;echo-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;1.0.0&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-plugin-plugin&lt;/artifactId&gt;
&lt;version&gt;3.2&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;mojo-descriptor&lt;/id&gt;
&lt;goals&gt;
&lt;goal&gt;descriptor&lt;/goal&gt;
&lt;/goals&gt;
&lt;configuration&gt;
&lt;skipErrorNoDescriptorsFound&gt;true&lt;/skipErrorNoDescriptorsFound&gt;
&lt;/configuration&gt;
&lt;/execution&gt;
&lt;execution&gt;
&lt;id&gt;help-goal&lt;/id&gt;
&lt;goals&gt;
&lt;goal&gt;helpmojo&lt;/goal&gt;
&lt;/goals&gt;
&lt;configuration&gt;
&lt;skipErrorNoDescriptorsFound&gt;true&lt;/skipErrorNoDescriptorsFound&gt;
&lt;/configuration&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;configuration&gt;
&lt;skipErrorNoDescriptorsFound&gt;true&lt;/skipErrorNoDescriptorsFound&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;/plugins&gt;
&lt;/pluginManagement&gt;
&lt;plugins&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
&lt;artifactId&gt;build-helper-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;1.8&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;regex-property&lt;/id&gt;
&lt;phase&gt;validate&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;regex-property&lt;/goal&gt;
&lt;/goals&gt;
&lt;configuration&gt;
&lt;name&gt;shortGroupId&lt;/name&gt;
&lt;value&gt;common&lt;/value&gt;
&lt;regex&gt;^TOKEN\.(.+)&lt;/regex&gt;
&lt;replacement&gt;$1&lt;/replacement&gt;
&lt;failIfNoMatch&gt;false&lt;/failIfNoMatch&gt;
&lt;/configuration&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-source-plugin&lt;/artifactId&gt;
&lt;version&gt;2.2.1&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;attach-sources&lt;/id&gt;
&lt;goals&gt;
&lt;goal&gt;jar-no-fork&lt;/goal&gt;
&lt;/goals&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;inherited&gt;true&lt;/inherited&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
&lt;version&gt;2.9&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;attach-javadocs&lt;/id&gt;
&lt;goals&gt;
&lt;goal&gt;jar&lt;/goal&gt;
&lt;/goals&gt;
&lt;configuration&gt;
&lt;quiet&gt;true&lt;/quiet&gt;
&lt;/configuration&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;configuration&gt;
&lt;quiet&gt;true&lt;/quiet&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-release-plugin&lt;/artifactId&gt;
&lt;version&gt;2.4.1&lt;/version&gt;
&lt;configuration combine.self=&quot;override&quot;&gt;
&lt;releaseProfiles&gt;release&lt;/releaseProfiles&gt;
&lt;workingDirectory&gt;F:/Data/rel/${buildDefinitionId}/${buildLabel}&lt;/workingDirectory&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
&lt;version&gt;2.3&lt;/version&gt;
&lt;configuration&gt;
&lt;webResources&gt;
&lt;resource&gt;
&lt;directory&gt;src/main/webapp&lt;/directory&gt;
&lt;filtering&gt;true&lt;/filtering&gt;
&lt;includes&gt;
&lt;include&gt;about.html&lt;/include&gt;
&lt;/includes&gt;
&lt;/resource&gt;
&lt;/webResources&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-toolchains-plugin&lt;/artifactId&gt;
&lt;version&gt;3.1.0&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;jenkins-plugin&lt;/id&gt;
&lt;phase&gt;validate&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;toolchain&lt;/goal&gt;
&lt;/goals&gt;
&lt;configuration&gt;
&lt;toolchains&gt;
&lt;jdk&gt;
&lt;version&gt;1.8&lt;/version&gt;
&lt;vendor&gt;redhat&lt;/vendor&gt;
&lt;arch&gt;64&lt;/arch&gt;
&lt;/jdk&gt;
&lt;/toolchains&gt;
&lt;/configuration&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;configuration&gt;
&lt;toolchains&gt;
&lt;jdk&gt;
&lt;version&gt;1.8&lt;/version&gt;
&lt;vendor&gt;redhat&lt;/vendor&gt;
&lt;arch&gt;64&lt;/arch&gt;
&lt;/jdk&gt;
&lt;/toolchains&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
&lt;artifactId&gt;xmlbeans-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;2.3.3&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;phase&gt;generate-sources&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;xmlbeans&lt;/goal&gt;
&lt;goal&gt;xmlbeans-test&lt;/goal&gt;
&lt;/goals&gt;
&lt;configuration&gt;
&lt;schemaDirectory&gt;//Path-to-schemaDirectory&lt;/schemaDirectory&gt;
&lt;source&gt;1.8&lt;/source&gt;
&lt;target&gt;1.8&lt;/target&gt;
&lt;/configuration&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;configuration&gt;
&lt;schemaDirectory&gt;//Path-to-schemaDirectory&lt;/schemaDirectory&gt;
&lt;source&gt;1.8&lt;/source&gt;
&lt;target&gt;1.8&lt;/target&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
&lt;version&gt;2.5&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;default-clean&lt;/id&gt;
&lt;phase&gt;clean&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;clean&lt;/goal&gt;
&lt;/goals&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
&lt;version&gt;2.6&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;default-testResources&lt;/id&gt;
&lt;phase&gt;process-test-resources&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;testResources&lt;/goal&gt;
&lt;/goals&gt;
&lt;/execution&gt;
&lt;execution&gt;
&lt;id&gt;default-resources&lt;/id&gt;
&lt;phase&gt;process-resources&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;resources&lt;/goal&gt;
&lt;/goals&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
&lt;version&gt;2.4&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;default-jar&lt;/id&gt;
&lt;phase&gt;package&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;jar&lt;/goal&gt;
&lt;/goals&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
&lt;version&gt;3.1&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;default-compile&lt;/id&gt;
&lt;phase&gt;compile&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;compile&lt;/goal&gt;
&lt;/goals&gt;
&lt;configuration&gt;
&lt;source&gt;1.8&lt;/source&gt;
&lt;target&gt;1.8&lt;/target&gt;
&lt;encoding&gt;ISO-8859-1&lt;/encoding&gt;
&lt;/configuration&gt;
&lt;/execution&gt;
&lt;execution&gt;
&lt;id&gt;default-testCompile&lt;/id&gt;
&lt;phase&gt;test-compile&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;testCompile&lt;/goal&gt;
&lt;/goals&gt;
&lt;configuration&gt;
&lt;source&gt;1.8&lt;/source&gt;
&lt;target&gt;1.8&lt;/target&gt;
&lt;encoding&gt;ISO-8859-1&lt;/encoding&gt;
&lt;/configuration&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;configuration&gt;
&lt;source&gt;1.8&lt;/source&gt;
&lt;target&gt;1.8&lt;/target&gt;
&lt;encoding&gt;ISO-8859-1&lt;/encoding&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
&lt;version&gt;2.15&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;default-test&lt;/id&gt;
&lt;phase&gt;test&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;test&lt;/goal&gt;
&lt;/goals&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-install-plugin&lt;/artifactId&gt;
&lt;version&gt;2.4&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;default-install&lt;/id&gt;
&lt;phase&gt;install&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;install&lt;/goal&gt;
&lt;/goals&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
&lt;version&gt;2.7&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;default-deploy&lt;/id&gt;
&lt;phase&gt;deploy&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;deploy&lt;/goal&gt;
&lt;/goals&gt;
&lt;configuration&gt;
&lt;updateReleaseInfo&gt;true&lt;/updateReleaseInfo&gt;
&lt;/configuration&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;configuration&gt;
&lt;updateReleaseInfo&gt;true&lt;/updateReleaseInfo&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;artifactId&gt;maven-site-plugin&lt;/artifactId&gt;
&lt;version&gt;3.2&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;default-site&lt;/id&gt;
&lt;phase&gt;site&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;site&lt;/goal&gt;
&lt;/goals&gt;
&lt;configuration&gt;
&lt;reportPlugins&gt;
&lt;reportPlugin&gt;
&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
&lt;artifactId&gt;maven-project-info-reports-plugin&lt;/artifactId&gt;
&lt;/reportPlugin&gt;
&lt;/reportPlugins&gt;
&lt;/configuration&gt;
&lt;/execution&gt;
&lt;execution&gt;
&lt;id&gt;default-deploy&lt;/id&gt;
&lt;phase&gt;site-deploy&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;deploy&lt;/goal&gt;
&lt;/goals&gt;
&lt;configuration&gt;
&lt;reportPlugins&gt;
&lt;reportPlugin&gt;
&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
&lt;artifactId&gt;maven-project-info-reports-plugin&lt;/artifactId&gt;
&lt;/reportPlugin&gt;
&lt;/reportPlugins&gt;
&lt;/configuration&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;configuration&gt;
&lt;reportPlugins&gt;
&lt;reportPlugin&gt;
&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
&lt;artifactId&gt;maven-project-info-reports-plugin&lt;/artifactId&gt;
&lt;/reportPlugin&gt;
&lt;/reportPlugins&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;/plugins&gt;

</build>
</project>


</details>
# 答案1
**得分**: 0
xmlbeans-maven-plugin 的版本太旧。可以通过覆盖其配置使其与 Java 8 兼容,但无法与更高版本的 Java 兼容。尝试升级到新版本。
<details>
<summary>英文:</summary>
The version of xmlbeans-maven-plugin is too old. It can be made to work with java 8 by overriding it&#39;s configuration but not with a higher java version. Try to upgrade to a newer version.
</details>
# 答案2
**得分**: 0
在尝试了多种方法后,我发现问题是由于 org.codehaus.mojo:xmlbeans-maven-plugin[:2.3.3] 导致的。这个答案似乎涵盖了我的情况。如果你遇到这个错误:
error: Source option 1.4 is no longer supported. Use 6 or later.
error: Target option 1.4 is no longer supported. Use 1.6 or later.
似乎是插件尝试在 1.4 版本下编译代码,而实际应该使用更高版本的 jdk。可以通过设置 xmlbeans-maven-plugin 的 javaSource 版本并添加 noJavac 标签来覆盖这个设置,以防止它使用 maven 正在使用的 jdk。
<javaSource>1.6</javaSource><!-- 只有“1.5+”实际上被识别,其他值会恢复到“1.4”代码 -->
<noJavac>true</noJavac><!-- 防止 XmlBeans 直接调用 javac 使用“-source 1.6”,这在新的 Java 版本上不受支持 -->
希望对遇到相同问题的人有所帮助。
注:最终应将 XMLBeans 更改为更新版本,并使用后续版本提供的新插件,而不是 xmlbeans-maven-plugin[:2.3.3]。在我们的情况下,我们需要将此库移至更新的 jenkin 服务器,而不是更新。
<details>
<summary>英文:</summary>
After wasting the days trying multiple thing I found that the problem is dues to org.codehaus.mojo:xmlbeans-maven-plugin[:2.3.3]. 
This answer https://github.com/ethercis/openehr-java-libs/issues/1 seem to cover my case. 
If you have this error: 
error: Source option 1.4 is no longer supported. Use 6 or later.
error: Target option 1.4 is no longer supported. Use 1.6 or later.
It seem to be the plugin trying to compile code in 1.4 when it should be using a more recent jdk. This can be overiden be setting the javaSource version for xmlbeans-maven-plugin and adding the noJavac tag to prevent it from using the jdk maven is using. 
&lt;javaSource&gt;1.6&lt;/javaSource&gt;&lt;!-- only &quot;1.5+&quot; is actually recognized, others values revert to &quot;1.4&quot; code --&gt;
&lt;noJavac&gt;true&lt;/noJavac&gt;&lt;!-- prevent XmlBeans from calling javac directly with &quot;-source 1.6&quot;, which is unsupported on new Java versions --&gt;
Hope this help anyone who have the same problem. 
Note: ultimatly XMLBeans should be change to a more recent version and use the new plugin provided with later version not xmlbeans-maven-plugin[:2.3.3]. In our case we needed this lib to be move to newer jenkin server not updated. 
</details>

huangapple
  • 本文由 发表于 2023年5月30日 06:28:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76360642.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定