'source [Beans.xml] cannot be opened because it does not exist

I'm trying to package a Spring Project with Maven, but the Beans.xml file is missing. A lot of people suggest to put the Bean.xml file in the main/resources, but it does not work for me. I think that only works for Eclipse user and I'm just compiling in the terminal using 'mvn clean install'.



Solution 1:[1]

Stupid mistake, inside my pom file the directory was like the following:

  <build>
<resources>
  <resource>
    <directory>src/resources</directory>
     <includes>
         <include>**/*.properties</include>
         <include>**/*.xml</include>
    </includes>
    <excludes>
      <exclude>**/*.jpeg</exclude>
      <exclude>**/*.gif</exclude>
    </excludes>
  </resource>

My resources folder was not inside src/main/resources, but src/resources. And when I open my jar file the Beans.xml file this there and the code runs without error.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Flying Nimbus