注释处理器' io.vertx.serviceproxy.ServiceProxyProcessor'未找到

时间:2017-11-17 02:40:32

标签: java vert.x

http://vertx.io/docs/vertx-service-proxy/java/

<dependency>
  <groupId>io.vertx</groupId>
  <artifactId>vertx-service-proxy</artifactId>
  <version>3.5.0</version>
  <classifier>processor</classifier>
</dependency>

<plugin>
  <artifactId>maven-compiler-plugin</artifactId>
  <configuration>
    <annotationProcessors>
      <annotationProcessor>io.vertx.serviceproxy.ServiceProxyProcessor</annotationProcessor>
    </annotationProcessors>
  </configuration>
</plugin>

ServiceProxyProcessor可从IDE解析

我错过了什么吗?

[错误]编译错误: [INFO] ----------------------------------------------- -------------- [错误]注释处理器&#39; io.vertx.serviceproxy.ServiceProxyProcessor&#39;找不到

-

我仍然可以用

完成这项工作
   <plugin>
            <groupId>org.bsc.maven</groupId>
            <artifactId>maven-processor-plugin</artifactId>
            <version>3.3.2</version>
            <executions>
                <execution>
                    <id>process</id>
                    <goals>
                        <goal>process</goal> <!-- see the "vertx-service-proxy" -->
                    </goals>
                    <!-- http://maven.apache.org/ref/3.5.0/maven-core/lifecycles.html -->
                    <phase>generate-sources</phase>
                    <configuration>
                        <!-- source output directory -->
                        <outputDirectory>src/main/generated</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>

未指定ServiceProxyProcessor

但我不确定这是不正确的做法,因为它不在文档中。

1 个答案:

答案 0 :(得分:1)

您不需要配置编译器插件,pom的工作示例可能是:

<?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>demo</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <dependencies>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
      <version>3.5.0</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-service-proxy</artifactId>
      <version>3.5.0</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-codegen</artifactId>
      <version>3.5.0</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-service-proxy</artifactId>
      <version>3.5.0</version>
      <scope>provided</scope>
      <classifier>processor</classifier>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.1</version>
          <configuration>
            <source>1.8</source>
            <target>1.8</target>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
相关问题