Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven build doesn't include hibernate cfg.xml or hbm.xml files

I'm building and executable-jar but the jar doesn't include the cfg or hbm hibernate files. My pom file contains the following:

<build>
    <plugins>
       <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
          <mainClass>com.myCompany.myProject.myMainClass</mainClass>
                    </manifest>
                </archive>
            </configuration>
        </plugin>

    </plugins>
    </build>

I'm using the following to build it:

mvn clean package shade:shade

I get errors that my hibernate cfg and hbm files cannot be found.

Any ideas? I've burned many BTUs on this already. Thanks in advance.

like image 782
Micho Rizo Avatar asked Aug 12 '13 18:08

Micho Rizo


Video Answer


1 Answers

put those files in src/main/resources maven takes everything in package from resources

like image 176
jmj Avatar answered Sep 27 '22 19:09

jmj