I've been using this strategy for awhile, I would include my SQL statements in the JAR Artifact for my project, and read it at run-time using getResourceAsStream().
However in this new project IntelliJ fails to add these files to my JAR.
See image:
However, in another project it seems to work fine.
I've attempted to close/reopen IntelliJ, no fix.
I've attempted to delete my Artifact build and recreate from scratch, no fix.
Putting the files manually into the JAR works, but I need this to be part of the build process, and generation for the JAR.
I'm out of ideas.
Here is the answer.
If you create your project as a MAVEN project it will have this behavior and therefore you will need to figure out how to include fix this when its setup as a maven project.
OR.
You remove the configuration in the project.iml file.
Example:
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
To:
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
A rebuild of my project generated an Artifact JAR correctly.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.