Changeset 6224 for ComponentRegistry


Ignore:
Timestamp:
05/19/15 09:34:36 (9 years ago)
Author:
Twan Goosen
Message:

reading datasource properties from file

Location:
ComponentRegistry/trunk/ComponentSpecFixer
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentSpecFixer/pom.xml

    r6223 r6224  
    4141                            <classpathPrefix>lib/</classpathPrefix>
    4242                        </manifest>
     43                        <manifestEntries>
     44                            <Class-Path>.</Class-Path>
     45                        </manifestEntries>
    4346                    </archive>
    4447                </configuration>
     
    6568                </executions>
    6669            </plugin>
     70            <plugin>
     71                <artifactId>maven-resources-plugin</artifactId>
     72                <version>2.7</version>
     73                <executions>
     74                    <execution>
     75                        <id>copy-resources</id>
     76                        <phase>validate</phase>
     77                        <goals>
     78                            <goal>copy-resources</goal>
     79                        </goals>
     80                        <configuration>
     81                            <outputDirectory>${basedir}/target</outputDirectory>
     82                            <resources>
     83                                <resource>
     84                                    <directory>src/main/resources/conf</directory>
     85                                </resource>
     86                            </resources>
     87                        </configuration>
     88                    </execution>
     89                </executions>
     90            </plugin>
    6791        </plugins>
    6892    </build>
  • ComponentRegistry/trunk/ComponentSpecFixer/src/main/java/nl/mpi/componentspecfixer/ComponentSpecFixer.java

    r6223 r6224  
    1 /*
    2  * To change this license header, choose License Headers in Project Properties.
    3  * To change this template file, choose Tools | Templates
    4  * and open the template in the editor.
    5  */
    61package nl.mpi.componentspecfixer;
    72
     
    4439    private static final Logger logger = LoggerFactory.getLogger(ComponentSpecFixer.class);
    4540    private static final String XSLT_RESOURCE = "/xslt/collapse-component-spec.xsl";
    46     private static final boolean DRY_RUN = false;
     41    private static final boolean DRY_RUN = true;
    4742
    4843    private ClassPathXmlApplicationContext applicationContext;
  • ComponentRegistry/trunk/ComponentSpecFixer/src/main/resources/spring-config/applicationContext.xml

    r6221 r6224  
    3333        <bean
    3434                class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    35                 <property name="location"
    36                         value="classpath:spring-config/component-registry.properties" />
    37                 <property name="ignoreResourceNotFound" value="true" />
     35                <property name="locations">
     36                    <list>
     37                        <value>classpath:spring-config/component-registry.properties</value>
     38                        <value>classpath:datasource.properties</value>
     39                    </list>
     40                </property>
     41                <property name="ignoreResourceNotFound" value="false" />
    3842        </bean>
    3943
  • ComponentRegistry/trunk/ComponentSpecFixer/src/main/resources/spring-config/container-environment.xml

    r6221 r6224  
    99     http://www.springframework.org/schema/aop/spring-aop.xsd
    1010     http://www.springframework.org/schema/context
    11      http://www.springframework.org/schema/context/spring-context.xsd
     11     http://www.springframework.org/schema/context/spring-context-3.2.xsd
    1212     ">
    1313
    14     <!-- Using the Datasource JNDI defined in the servlet container. See below
    15     for a sample Tomcat datasource configuration. We need TransactionAwareDataSourceProxy
    16     because of the mixed access of plain JDBC and JPA. JDBCTemplate will close
    17     the database connection otherwise. -->
     14    <!--<context:property-placeholder location="datasource.properties"/>-->
    1815
    19     <bean id="dataSource"
    20               class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
     16<!--    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
     17        <property name="location" value="datasource.properties" />
     18        <property name="ignoreResourceNotFound" value="false" />
     19    </bean>-->
     20       
     21    <!-- Using the Datasource taking properties from a property file.
     22    We need TransactionAwareDataSourceProxy because of the mixed access of plain
     23    JDBC and JPA. JDBCTemplate will close the database connection otherwise. -->
     24
     25    <bean id="dataSource" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
    2126        <property name="targetDataSource" ref="applicationServerDataSource"/>
    2227    </bean>
    23 
     28   
    2429
    2530    <bean id="applicationServerDataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
    26         <property name="driverClass" value="org.postgresql.Driver" />
    27         <property name="url" value="jdbc:postgresql://localhost:5432/component_registry" />
    28         <property name="username" value="compreg" />
    29         <property name="password" value="compreg" />
     31        <property name="driverClass" value="${database.driver}" />
     32        <property name="url" value="${database.url}" />
     33        <property name="username" value="${database.username}" />
     34        <property name="password" value="${database.password}" />
    3035    </bean>
    3136    <!--
Note: See TracChangeset for help on using the changeset viewer.