I have a Gradle project in IntelliJ.
I added this dependency to Maven dependencies list
<dependency> <groupId>org.imgscalr</groupId> <artifactId>imgscalr-lib</artifactId> <version>4.2</version> <type>jar</type> <scope>compile</scope> </dependency> When I try to compile my code using gradlew build I receive this compilation error:
gradlew build :compileJava ....java:5: error: package org.imgscalr does not exist import org.imgscalr.Scalr; ^ ....java:52: error: cannot find symbol BufferedImage thumbnail = Scalr.resize(image, 150); ^ symbol: variable Scalr location: class PlaceController 2 errors :compileJava FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileJava'. > Compilation failed; see the compiler error output for details. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED What is happening?
After adding the dependency inside maven file, IntelliJ automatically downloads the file and imports it where it is needed. By doing this, the error from the IDE, that says tahat Scalr could not be found, dissapears.
pom.xmlfile.