Package doesnt exist (using maven but also happens with gradle)
已回答
Hi,
So im trying to use the WordUtils thing from apache. I've imported it into intellij:
But when I build the project I get the error saying: package org.apache.commons.text does not exist
Note: I've tried literally everything online from forums: such as, deleting .idea and invalidating cache. Nothing worked. Im running Intellij Version 2022.1.4 (most recent at the time of posting). Can anyone help?
Note.2: Im developing a spigot plugin (for Minecraft) in case that changed anything.
请先登录再写评论。
When working with Maven, IntelliJ IDEA imports almost everything from the pom.xml file. So, any changes you want to make (like adding dependencies, for instance), you need to make them in the pom.xml, otherwise they will be overridden by the current contents of your pom file during the next Maven sync.
So, instead of adding the library manually, try adding the following to the <dependencies> section of your pom.xml file (copied from Maven central):
See also: