0

New JAVA clean project. I tried to add new dependency for @Inject and other stuff. My pom looks like it has only got project info and this single dependency:

    <dependency>
        <groupId>javax.enterprise</groupId>
        <artifactId>cdi-api</artifactId>
        <version>LATEST</version>
    </dependency>

Got sth like this in Project Structure. My .m2/repository directory has got multiple directories with jar files.

enter image description here

I tried to reimport, invalidate cache and restart, reinstall completely new IntelliJ IDEA and more.

How to fix this?

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
y07k2
  • 1,898
  • 4
  • 20
  • 36
  • [Can't reproduce](https://i.imgur.com/yjq3Byv.png). How do the paths look like when you double click on a library? Does it build/run from the command line Maven without errors? See [this answer](https://stackoverflow.com/a/42427510/104891) for the diagnostics. – CrazyCoder May 18 '19 at 10:57
  • For all Classes/Sources/JavaDocs is world icon with small red square and the address is `C:\Users\xxx\.m2\repository\javax\enterprise\cdi-api\2.0-PFD2\cdi-api-2.0-PFD2.jar` (all others `-sources.jar` and `-javadoc.jar` are in `.m2\repository` tree. – y07k2 May 18 '19 at 11:07
  • There is an exception in idea.log: `Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources (default-resources) on project xxx: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources failed: Unable to load the mojo 'resources' (or one of its required components) from the plugin 'org.apache.maven.plugins:maven-resources-plugin:2.6' java.lang.RuntimeException`. Full log here: https://pastebin.com/WVtfhfvJ. – y07k2 May 18 '19 at 11:09
  • Is your `pom.xml` valid? Does `mvn clean package` complete without errors in the command line? [Try this](https://stackoverflow.com/a/5413105/104891). – CrazyCoder May 18 '19 at 11:33
  • It completed with: `[WARNING] Error injecting: org.apache.maven.plugin.resources.ResourcesMojo com.google.inject.ProvisionException: Unable to provision, see the following errors: 1) No implementation for org.apache.maven.shared.filtering.MavenResourcesFiltering was bound. while locating org.apache.maven.plugin.resources.ResourcesMojo 1 error` and `[ERROR] 1 error [ERROR] role: org.apache.maven.plugin.Mojo [ERROR] roleHint: org.apache.maven.plugins:maven-resources-plugin:2.6:resources [ERROR] -> [Help 1]` – y07k2 May 18 '19 at 12:05
  • it is generated even if `pom.xml` is empty (empty of dependencies) – y07k2 May 18 '19 at 12:07
  • Delete the m2 directory. – CrazyCoder May 18 '19 at 18:02
  • @CrazyCoder I tried it before but unfortunately, won't work. – y07k2 May 19 '19 at 14:19
  • This doesn't look like IntelliJ IDEA specific issue since you have it in the command line Maven as well. Reinstall Maven and remove any Maven related files from your system to start from scratch. – CrazyCoder May 19 '19 at 19:54

0 Answers0