<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation=...
<overWriteSnapshots>false</overWriteSnapshots> <overWriteIfNewer>true</overWriteIfNewer> ...
<artifactId>ojdbc6</artifactId> <version>11.2.0</version> </dependency> <depende...
<bean id="myDataSource"class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="dri...
<propkey="hibernate.show_sql">${hibernate.show_sql}</prop> </props> </property> ...
of 5

Pom configuration java xml

Java related
Published on: Mar 4, 2016
Published in: Education      Technology      
Source: www.slideshare.net


Transcripts - Pom configuration java xml

  • 1. <project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.lk.jkcs.test</groupId> <artifactId>MyTestProject</artifactId> <version>0.0.1-SNAPSHOT</version> <build> <extensions> <extension> <groupId>commons-net</groupId> <artifactId>commons-net</artifactId> <version>1.4.1</version> </extension> <extension> <groupId>oro</groupId> <artifactId>oro</artifactId> <version>2.0.8</version> </extension> <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-webdav-jackrabbit</artifactId> <version>1.0-beta-6</version> </extension> <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-ssh-external</artifactId> <version>1.0-alpha-5</version> </extension> </extensions> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.3</version> <executions> <execution> <id>copy-dependencies</id> <phase>install</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <overWriteReleases>false</overWriteReleases>
  • 2. <overWriteSnapshots>false</overWriteSnapshots> <overWriteIfNewer>true</overWriteIfNewer> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix>dependency/</classpathPrefix> <mainClass>com.lk.jkcs.test.application.AppplicaitonContextLoaderr</mainClass> </manifest> </archive> </configuration> </plugin> </plugins> </build><dependencies> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> <version>3.3.1.GA</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.3.1</version> <scope>test</scope> </dependency> <dependency> <groupId>com.oracle</groupId>
  • 3. <artifactId>ojdbc6</artifactId> <version>11.2.0</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>2.5.6.SEC01</version> </dependency> <dependency> <groupId>commons-net</groupId> <artifactId>commons-net</artifactId> <version>1.4.1</version> </dependency><dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.14</version></dependency> </dependencies></project><?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> <context:annotation-config/> <tx:annotation-driven/> <context:property-placeholderlocation="classpath:hibernate.properties"/>
  • 4. <bean id="myDataSource"class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"> <value>${hibernate.connection.driver_class}</value> </property> <property name="url"> <value>${hibernate.connection.url}</value> </property> <property name="username"> <value>${hibernate.connection.username}</value> </property> <property name="password"> <value>${hibernate.connection.password}</value> </property> </bean> <bean id="sessionFactory"class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" > <property name="dataSource" ref="myDataSource"/> <property name="annotatedClasses"> <list> <value>com.lk.jkcs.test.domain.Student</value> <value>com.lk.jkcs.test.domain.Course</value> </list> </property> <property name="hibernateProperties"> <props> <propkey="hibernate.dialect">${hibernate.dialect}</prop> <propkey="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
  • 5. <propkey="hibernate.show_sql">${hibernate.show_sql}</prop> </props> </property> </bean> <bean id="transactionManager"class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory"><refbean="sessionFactory"/></property> </bean> <context:component-scan base-package="com.lk.jkcs.test.infrastructure"></context:component-scan> <bean id ="controller" class="com.lk.jkcs.test.application.AppplicaitonContextLoader"></bean></beans>