[ 
https://issues.apache.org/jira/browse/FLINK-22610?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

LIU Xiao updated FLINK-22610:
-----------------------------
    Description: 
The test-jar of old kafka connector (flink-connector-kafka-base and 
flink-connector-kafka-0.11) includes convenient utility classes 
(KafkaTestEnvironment and KafkaTestEnvironmentImpl, etc.) to start an embedded 
kafka in unit test, and we used the utility classes to build some test cases 
for our project.

Now the utility classes other than KafkaTestEnvironmentImpl seem to be gone in 
test-jar of new kafka connector (flink-connector-kafka), and I find that is 
because they are not included in the configuration of maven-jar-plugin in 
pom.xml:
{code:xml}
...
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <executions>
        <execution>
            <goals>
                <goal>test-jar</goal>
            </goals>
            <configuration>
                <includes>
                    <include>**/KafkaTestEnvironmentImpl*</include>
                    <include>META-INF/LICENSE</include>
                    <include>META-INF/NOTICE</include>
                </includes>
            </configuration>
        </execution>
    </executions>
</plugin>
...
{code}
This configuration seems to be inherited from flink-connector-kafka-0.11, but 
actually the configuration of flink-connector-kafka-base should be used:
{code:xml}
...
<plugin>
    <artifactId>maven-jar-plugin</artifactId>
    <executions>
        <execution>
            <goals>
                <goal>test-jar</goal>
            </goals>
        </execution>
    </executions>
</plugin>
...
{code}
The test-source-jar has similar problem:
{code:xml}
...
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-source-plugin</artifactId>
    <executions>
        <execution>
            <id>attach-test-sources</id>
            <goals>
                <goal>test-jar-no-fork</goal>
            </goals>
            <configuration>
                <archive>
                    <!-- Globally exclude maven metadata, because it may 
accidentally bundle files we don't intend to -->
                    <addMavenDescriptor>false</addMavenDescriptor>
                </archive>
                <includes>
                    <include>**/KafkaTestEnvironmentImpl*</include>
                    <include>META-INF/LICENSE</include>
                    <include>META-INF/NOTICE</include>
                </includes>
            </configuration>
        </execution>
    </executions>
</plugin>
...
{code}
I think it should be:
{code:xml}
...
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-source-plugin</artifactId>
    <executions>
        <execution>
            <id>attach-test-sources</id>
            <goals>
                <goal>test-jar-no-fork</goal>
            </goals>
            <configuration>
                <archive>
                    <!-- Globally exclude maven metadata, because it may 
accidentally bundle files we don't intend to -->
                    <addMavenDescriptor>false</addMavenDescriptor>
                </archive>
            </configuration>
        </execution>
    </executions>
</plugin>
...
{code}

  was:
The test-jar of old kafka connector (flink-connector-kafka-base and 
flink-connector-kafka-0.11) includes convenient utility classes 
(KafkaTestEnvironment and KafkaTestEnvironmentImpl, etc.) to start an embedded 
kafka in unit test, and we used the utility classes to build some test cases 
for our project.

Now the utility classes other than KafkaTestEnvironmentImpl seem to be gone in 
test-jar of new kafka connector (flink-connector-kafka), and I find that is 
because they are not included in the configuration of maven-jar-plugin in 
pom.xml:
{code:java}
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <executions>
                <execution>
                    <goals>
                        <goal>test-jar</goal>
                    </goals>
                    <configuration>
                        <includes>
                            <include>**/KafkaTestEnvironmentImpl*</include>
                            <include>META-INF/LICENSE</include>
                            <include>META-INF/NOTICE</include>
                        </includes>
                    </configuration>
                </execution>
            </executions>
        </plugin>
{code}
This configuration seems to be inherited from flink-connector-kafka-0.11, but I 
think the configuration of flink-connector-kafka-base should be used:
{code:java}
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
{code}


> The test-jar and test-source-jar of flink-connector-kafka should include all 
> classes
> ------------------------------------------------------------------------------------
>
>                 Key: FLINK-22610
>                 URL: https://issues.apache.org/jira/browse/FLINK-22610
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / Kafka
>    Affects Versions: 1.13.0, 1.12.3
>            Reporter: LIU Xiao
>            Priority: Minor
>
> The test-jar of old kafka connector (flink-connector-kafka-base and 
> flink-connector-kafka-0.11) includes convenient utility classes 
> (KafkaTestEnvironment and KafkaTestEnvironmentImpl, etc.) to start an 
> embedded kafka in unit test, and we used the utility classes to build some 
> test cases for our project.
> Now the utility classes other than KafkaTestEnvironmentImpl seem to be gone 
> in test-jar of new kafka connector (flink-connector-kafka), and I find that 
> is because they are not included in the configuration of maven-jar-plugin in 
> pom.xml:
> {code:xml}
> ...
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-jar-plugin</artifactId>
>     <executions>
>         <execution>
>             <goals>
>                 <goal>test-jar</goal>
>             </goals>
>             <configuration>
>                 <includes>
>                     <include>**/KafkaTestEnvironmentImpl*</include>
>                     <include>META-INF/LICENSE</include>
>                     <include>META-INF/NOTICE</include>
>                 </includes>
>             </configuration>
>         </execution>
>     </executions>
> </plugin>
> ...
> {code}
> This configuration seems to be inherited from flink-connector-kafka-0.11, but 
> actually the configuration of flink-connector-kafka-base should be used:
> {code:xml}
> ...
> <plugin>
>     <artifactId>maven-jar-plugin</artifactId>
>     <executions>
>         <execution>
>             <goals>
>                 <goal>test-jar</goal>
>             </goals>
>         </execution>
>     </executions>
> </plugin>
> ...
> {code}
> The test-source-jar has similar problem:
> {code:xml}
> ...
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-source-plugin</artifactId>
>     <executions>
>         <execution>
>             <id>attach-test-sources</id>
>             <goals>
>                 <goal>test-jar-no-fork</goal>
>             </goals>
>             <configuration>
>                 <archive>
>                     <!-- Globally exclude maven metadata, because it may 
> accidentally bundle files we don't intend to -->
>                     <addMavenDescriptor>false</addMavenDescriptor>
>                 </archive>
>                 <includes>
>                     <include>**/KafkaTestEnvironmentImpl*</include>
>                     <include>META-INF/LICENSE</include>
>                     <include>META-INF/NOTICE</include>
>                 </includes>
>             </configuration>
>         </execution>
>     </executions>
> </plugin>
> ...
> {code}
> I think it should be:
> {code:xml}
> ...
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-source-plugin</artifactId>
>     <executions>
>         <execution>
>             <id>attach-test-sources</id>
>             <goals>
>                 <goal>test-jar-no-fork</goal>
>             </goals>
>             <configuration>
>                 <archive>
>                     <!-- Globally exclude maven metadata, because it may 
> accidentally bundle files we don't intend to -->
>                     <addMavenDescriptor>false</addMavenDescriptor>
>                 </archive>
>             </configuration>
>         </execution>
>     </executions>
> </plugin>
> ...
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to