'processSOAPRequest An error occurred when trying to read the trust store using JConfig. The JConfig file being used was null

mvn resources:resources

would be

Hello My Resources Plugin Practice Project

That's because the name variable was replaced by the value of the project's name (which was specified in the POM).

Moreover, we can also assign values through the command line using the "-D" option. For example, to change the value for the variable name to "world", we can simply invoke this command:

mvn resources:resources -Dname="world"

And the output in target/classes/hello.txt would be

Hello world

Furthermore, we are not limited to use pre-defined project variables. We can specify our own variables and their values in the <properties> element. For example, if we want to change the variable from "name" to "your.name", we can do so by adding a <your.name> element within the <properties> element.

<project>
  ...
  <properties>
    <your.name>world</your.name>
  </properties>
  ...
</project>

But to organize your project, you may want to put all your variables and their values in a separate file so that you will not have to rewrite your POM, or set their values all the time with every build. This can be done by adding a filter.

<project>
  ...
  <name>My Resources Plugin Practice Project</name>
  ...
  <build>
    ...
    <filters>
      <filter>[a filter property]</filter>
    </filters>
    ...
  </build>
  ...
</project>

For example, we can separate "your.name" from the POM by specifying a filter file my-filter-values.properties containing:

your.name = world

and adding that to our POM

    ...
    <filters>
      <filter>my-filter-values.properties</filter>
    </filters>
    ...

Warning: Do not filter files with binary content like images! This will most likely result in corrupt output. If you have both text files and binary files as resources, you need to declare two mutually exclusive resource sets. The first resource set defines the files to be filtered and the other resource set defines the files to copy unaltered as illustrated below:

<project>
  ...
  <build>
    ...
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <includes>
       &

Back  [1] [2] [3] Next

Copyright © 2007-2012 www.chuibin.com Chuibin Copyright