1

I must be missing something in my maven file. When generating classes with avro-maven-plugin, I want to use them in a class in the same project. I am able to generate the classes in the target/classes , but cannot use them in classes living in source/main/java , the compiler does not find them.

   <plugin>
      <groupId>org.apache.avro</groupId>
         <artifactId>avro-maven-plugin</artifactId>
         <version>1.8.2</version>
         <executions>
            <execution>
               <phase>generate-sources</phase>
               <goals>
                  <goal>schema</goal>
               </goals>
            </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/avro/</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
glee8e
  • 6,180
  • 4
  • 31
  • 51
leoconco
  • 253
  • 3
  • 15

0 Answers0