Reputation: 11
So I recently came back to a old java project which had broken due to an outdated Java discord API (JDA) version. Upon updating the dependency tag to the latest version in maven and rebuilding, I have been getting package x does not exist errors.
I have tried reloading the project from maven, downloading sources, invalidating caches and rebuilding, none seem to fix the issue. I don't understand why this would be, as I have only changed the version of JDA. The packages still exist in the new version. Here are the relevant parts of my pom file.
<repositories>
<repository>
<id>dv8tion</id>
<name>m2-dv8tion</name>
<url>https://m2.dv8tion.net/releases</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-beta.11</version>
</dependency>
</dependencies>
</project>
I'm not very well versed in Java this was a side project for me, but any help would be very much appreciated. I'm sure I must be overlooking something obvious.
Upvotes: 0
Views: 157
Reputation: 11
So the problem was actually really bothering me, so I stayed up quite late and tried one last solution before going to bed. I had to go to File
> Project Structure
and remove all the modules using the delete (-)
button. Then I had to re-add the project as a maven project by right clicking the pom file and selecting add as maven project
and rebuilding. This seemed to fix the problem. Why it worked when nothing else did, I am not quite sure.
Upvotes: 1