Skip to content

Compile error due to unused import of a class which is not in the dependencies #959

@parenko

Description

@parenko

There are some unused imports of javax.activation.FileDataSource.

To reproduce the problem simply try to assemble the project $ ./gradlew assemble.
This produces an error output:

...
> Task :tests:utils:compileJava FAILED
/home/pawlik/Development/powermock/tests/utils/src/main/java/samples/privatemocking/PrivateMethodDemo.java:18: error: package javax.activation does not exist
import javax.activation.FileDataSource;
...

Environment

Affected PowerMock version 2.0.0-RC.5

IntelliJ IDEA 2018.3 (Community Edition)
Build #IC-183.4284.148, built on November 21, 2018
JRE: 1.8.0_152-release-1343-b15 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.0-39-generic

$ java -version
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions