пятница, 12 февраля 2016 г.

How to force mave to copy dependencies into target directory

Here is a simple example of pom.xml plugins section to force maven copy dependencies into target directory

       
                org.apache.maven.plugins
                maven-dependency-plugin
               
                   
                        copy-dependency
                        prepare-package
                       
                            copy-dependencies
                       
                       
                            ${project.build.directory}/lib
                            true
                            false
                            false
                       
                   
               

           

How to set specific java version in pom.xml

Here is an example of pom.xml plugins section to set specific java version:

           
                org.apache.maven.plugins
                maven-compiler-plugin
                2.5.1
               
                    1.7
                    1.7
               

           

Simple Hibernate configuration for PostgreSQL

Example of Hibernate configuration hibernate.cfg.xml for PostgreSQL


   
       
            org.hibernate.dialect.PostgreSQL94Dialect
       
       
            org.postgresql.Driver
       
       
            jdbc:postgresql://localhost/demo
       
        demo
        xxxxxxxxxxxxxxxxxxxxxxxx
        1
        true