Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-18387

Fix build script for shaded jvm-dtest JAR

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Review In Progress
    • Normal
    • Resolution: Unresolved
    • None
    • Build, Test/dtest/java
    • None
    • Packaging - Source Distribution
    • Low
    • Low Hanging Fruit
    • User Report
    • All
    • None
    • Hide

      Run ./build-shaded-dtest-jar.sh to confirm build is successful.

      Show
      Run ./build-shaded-dtest-jar.sh to confirm build is successful.

    Description

      On trunk as of 6a5f84d0f44f5562776a12a678c7d68168d2c7e7, ./build-shaded-dtest-jar.sh fails with errors related to org.apache.tools.ant.taskdefs.optional.junit package visibility:

      ...
          [javac]   symbol:   class JUnitTest
          [javac]   location: class CassandraXMLJUnitResultFormatter
          [javac] /cassandra/test/unit/org/apache/cassandra/JStackJUnitTask.java:27: error: package org.apache.tools.ant.taskdefs.optional.junit does not exist
          [javac] import org.apache.tools.ant.taskdefs.optional.junit.JUnitTask;
          [javac]                                                    ^
          [javac] /cassandra/test/unit/org/apache/cassandra/JStackJUnitTask.java:30: error: cannot find symbol
          [javac] public class JStackJUnitTask extends JUnitTask
          [javac]                                      ^
          [javac]   symbol: class JUnitTask
          [javac] Note: Processing compiler hints annotations
          [javac] Note: Writing compiler command file at META-INF/hotspot_compiler
          [javac] Note: Done processing compiler hints annotations
          [javac] 22 errors
      
      BUILD FAILED
      /cassandra/build.xml:999: The following error occurred while executing this line:
      /cassandra/build.xml:1012: Compile failed; see the compiler error output for details.
      

      Reproduced with Java 11, Maven 3.5.4, Ant 1.10.5.

      This is caused by the classpath exclusion of

      ${test.lib}/jars/**/ant-*.jar

      , which includes ant-junit, which is depended on by org.apache.cassandra.CassandraXMLJUnitResultFormatter.
      See: https://github.com/apache/cassandra/blob/6a5f84d0f44f5562776a12a678c7d68168d2c7e7/build.xml#L331

      To fix, update to include that library specifically:

               <fileset dir="${test.lib}/jars">
                   <include name="**/*.jar" />
                   <exclude name="**/ant-*.jar"/>
               </fileset>
      +        <fileset dir="${test.lib}/jars">
      +            <include name="**/ant-junit-*.jar" />
      +        </fileset>
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            aratnofsky Abe Ratnofsky
            Abe Ratnofsky
            Caleb Rackliffe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: