微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

由于谷歌自动服务处理器“无法获得公共无参数构造函数”,无法编译我的 javafx 和 selenium 项目

如何解决由于谷歌自动服务处理器“无法获得公共无参数构造函数”,无法编译我的 javafx 和 selenium 项目

我正在尝试使用 maven 编译我的 Instagram 机器人。它使用 javafx 作为接口,使用 selenium 作为自动化,我被这个错误困扰了很长时间。

当我尝试执行 mvn clean javafx:jlink 时,它向我显示错误

 Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.3:jlink (default-cli) on project igbot: Error: Unable to execute mojo: Compilation failure
[ERROR] Bad service configuration file,or exception thrown while constructing Processor object: javax.annotation.processing.Processor: com.google.auto.service.processor.AutoServiceProcessor Unable to get public no-arg constructor

关于这个问题,我发现的唯一一件事是: https://stackoverflow.com/a/36250332/15479657

我向我的 pom 添加了答案建议,但它似乎不起作用

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.1</version>
    <configuration>
        <source>9</source>
        <target>9</target>
    </configuration>
    <executions>
        <execution>
            <id>default-compile</id>
            <configuration>
                <compilerArgument>-proc:none</compilerArgument>
                <includes>
                    <include>com/google/auto/service/processor/AutoServiceProcessor.java</include>
                </includes>
            </configuration>
        </execution>
        <execution>
            <id>compile-project</id>
            <phase>compile</phase>
            <goals>
                <goal>compile</goal>
            </goals>
        </execution>
    </executions>
</plugin>

该帖子在包含后有评论<!--include dependencies required for LogMeCustomAnnotationProcessor --> 我是否必须包含 Google AutoServiceProcessor 依赖项?我如何获得它们?

我也尝试在我的 pom.xml 上手动添加像 Google AutoServiceProcessor 这样的依赖项,但它不起作用 (https://mvnrepository.com/artifact/com.google.auto.service/auto-service/1.0)

我错过了什么?提前致谢

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。