Artifact not including source java files
Hi there,
My project is stored on my NAS and through version control. I re-configured the NAS today (changed from windows to linux) and everything has been okay so far except for a weird issue I'm having.
For my java project, I compile with an artifact. It includes the "compile output" as it always has. Never had an issue.
Now, when I build my artifact, the jar file is created but includes everything BUT the source java files. It does include the resources and external maven dependencies that I've shaded into it.
I've done the following already:
- Made sure the source folder is correct, never has changed (folder in question is src/main/java)
- Attempted to build artifact by copying project location and pasting on local desktop (same issue)
- Creating a new empty artifact with only the compile output. This ends up only compiling the resources folder.
- Invalidated caches and restarted
- Re-installed the entire IDE
- Updated to the latest version (2021.1)
If anyone has any experience with this issue or suggestions on how to fix it, I would really appreciate it.
Cheers.
Please sign in to leave a comment.
Please share this screenshot:
https://i.imgur.com/w0L6Rt0.png
Here is the screenshot of a new artifact I've created (current one I'm using has a lot of libraries)
https://gyazo.com/1810ae4bf9776d7b7904378a76b589f3
Here is the decompiled jar. It only includes contents from the resources folder:
https://gyazo.com/9be115dc6edb67126f118eecf6bbf1c2
Does the program itself run without errors?
May you share a sample project?
Hi Konstantin,
I have created a sample project with one class. It compiles correctly.
I can send this to you if you'd like, but it is very strange how just this project has the problem.
I might try and delete the .idea folder and try it again. I will update this shortly with my findings.
I managed to fix this problem by deleting the .idea folder. The project now compiles normally.
Thank you for your assistance.
I got the same problem after renaming maven module shift+F6
The module "starter" was renamed, so does not extsts more. Changing the xml tag value manually, creating new artifact, restarting IDEA, clean with maven and rebuilding artifact does not fixed the problem. No more "starter" found in files for entire project.
After restaring IDEA with validate cache, i discovered what that renamed module "starter" was not loaded as a project module (marked as a simple folder in the project explorer, left panel), but was recognized by maven (maven right manel) and no errors. So reloading the maven configuration solved the problem.
IntelliJ IDEA 2021.2.3 Community