Note that there are some explanatory texts on larger screens.

plurals
  1. POmaven, eclipse and the filter
    primarykey
    data
    text
    <p>I use Maven to manage my project.</p> <p>I find <strong><code>&lt;properties&gt;</code></strong> tag very useful but there's a issue with this.</p> <p>When I deploy my sources to Tomcat, I should put <strong><code>/target/classes</code></strong> into Deployment Assembly to get converted resources.</p> <p>example ) <img src="https://i.stack.imgur.com/srjwO.jpg" alt="enter image description here"> I think this above is right.</p> <hr> <p><img src="https://i.stack.imgur.com/W5pvq.jpg" alt="enter image description here"> But I have to put <strong><code>/target/classes/</code></strong> to get converted properties.</p> <p><strong>Spring bean example)</strong></p> <pre><code>&lt;!-- Database --&gt; &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt; &lt;property name="driverClassName" value="${database.classname}" /&gt; &lt;property name="defaultAutoCommit" value="${database.defaultAutoCommit}" /&gt; &lt;property name="testWhileIdle" value="${database.testWhileIdle}" /&gt; &lt;property name="timeBetweenEvictionRunsMillis" value="${database.timeBetweenEvictionRunsMillis}" /&gt; &lt;property name="url" value="${database1.url}" /&gt; &lt;property name="username" value="${database1.username}" /&gt; &lt;property name="password" value="${database1.password}" /&gt; &lt;/bean&gt; </code></pre> <p>This pure variables just copied into Tomcat's webapp if I don't put <strong><code>/target/classes/</code></strong></p> <p>even though it works, this drives me crazy because Eclipse sometimes says <strong><code>"sources are not sychronized!"</code></strong></p> <hr> <p><strong>pom.xml</strong></p> <pre><code>... &lt;build&gt; &lt;sourceDirectory&gt;${basedir}/src/main/java&lt;/sourceDirectory&gt; &lt;outputDirectory&gt;${basedir}/target/webapp/WEB-INF/classes&lt;/outputDirectory&gt; &lt;resources&gt; &lt;resource&gt; &lt;directory&gt;${basedir}/src/main/webapp&lt;/directory&gt; &lt;targetPath&gt;${basedir}/target/webapp&lt;/targetPath&gt; &lt;/resource&gt; &lt;resource&gt; &lt;directory&gt;${basedir}/src/main/resources&lt;/directory&gt; &lt;targetPath&gt;${basedir}/target/webapp/WEB-INF/classes&lt;/targetPath&gt; &lt;filtering&gt;true&lt;/filtering&gt; &lt;/resource&gt; &lt;/resources&gt; &lt;filters&gt; &lt;filter&gt;${basedir}/src/main/resources/spring-common-bean-context.xml&lt;/filter&gt; &lt;filter&gt;${basedir}/src/main/resources/byto.cyoz.properties&lt;/filter&gt; &lt;/filters&gt; ... </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload