Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

#1786 breaks compilation with Eclipse compiler

未关闭
#2,000 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
java
领域
build-system

调研方向

首先检查 pull request #1786,以及添加了 javax.xml.stream:stax-api:1.0-2 的依赖声明。使用 dev.aspectj:aspectj-maven-plugin 的 test-compile 目标重现失败,并将其与标准 Maven 编译器进行比较。当使用 Eclipse 编译器的项目能够在不出现重复 java.xml 模块错误的情况下完成编译时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

https://github.com/microsoft/kiota-java/pull/1786 causes compilation of projects with Eclipse compiler to fail:

[ERROR] Failed to execute goal dev.aspectj:aspectj-maven-plugin:1.14:test-compile (default) on project kiota-xml: AJC compiler errors:
[ERROR] error at
[ERROR] import javax.xml.stream.XMLInputFactory;
[ERROR]        ^^^^^^^^^^^^^^^^
[ERROR] /kiota-xml/src/test/java/com/example/kiota/xml/Foobar.java:3:0::0 The package javax.xml.stream is accessible from more than one module: <unnamed>, java.xml
[ERROR] error at
[ERROR] System.out.println(XMLInputFactory.newInstance().getClass().getName());
[ERROR]                    ^^^^^^^^^^^^^^^
[ERROR] /kiota-xml/src/test/java/com/example/kiota/xml/Foobar.java:9:0::0 XMLInputFactory cannot be resolved

It compiles fine with the standard Maven compiler plugin. The error is caused by the addition of api 'javax.xml.stream:stax-api:1.0-2'. An exclusion can be used as a workaround.

package com.example.kiota.xml;

import javax.xml.stream.XMLInputFactory;


public class Foobar {

   public static void main( String[] args ) {
      System.out.println(XMLInputFactory.newInstance().getClass().getName());
   }
}
<?xml version="1.0" encoding="UTF-8"?>
<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>com.example</groupId>
   <artifactId>kiota-xml</artifactId>
   <version>1.0-SNAPSHOT</version>

   <properties>
      <aspectj.version>1.9.22.1</aspectj.version>
      <maven.compiler.source>21</maven.compiler.source>
      <maven.compiler.target>21</maven.compiler.target>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>

   <dependencies>
      <dependency>
         <groupId>com.microsoft.kiota</groupId>
         <artifactId>microsoft-kiota-authentication-azure</artifactId>
         <version>1.8.8</version>
      </dependency>

      <dependency>
         <groupId>org.aspectj</groupId>
         <artifactId>aspectjrt</artifactId>
         <version>${aspectj.version}</version>
      </dependency>
   </dependencies>

   <build>
      <plugins>
         <plugin>
            <groupId>dev.aspectj</groupId>
            <artifactId>aspectj-maven-plugin</artifactId>
            <version>1.14</version>
            <configuration>
               <release>21</release>
            </configuration>
            <executions>
               <execution>
                  <goals>
                     <goal>compile</goal>
                     <goal>test-compile</goal>
                  </goals>
               </execution>
            </executions>
            <dependencies>
               <dependency>
                  <groupId>org.aspectj</groupId>
                  <artifactId>aspectjrt</artifactId>
                  <version>${aspectj.version}</version>
               </dependency>
               <dependency>
                  <groupId>org.aspectj</groupId>
                  <artifactId>aspectjtools</artifactId>
                  <version>${aspectj.version}</version>
               </dependency>
            </dependencies>
         </plugin>
      </plugins>
   </build>
</project>
主要语言
Java
星标
38
派生
35
平均合并
15 小时 3 分钟
30 天内合并 PR
18

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/kiota-java 的其他 Issue

查看 microsoft/kiota-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。