<output> prepends "target"?

10 views
Skip to first unread message

omax

unread,
Jun 24, 2009, 1:34:31 AM6/24/09
to maven-config-processor-users
In plugin configuration documentation you show example:
<transformation>
<output>target/processed-files/my-
config.properties</output>

but plugins seems add target/ to output file itself so resulting file
is written to target/target/processed-files/my-config.properties
Is it a bug?

omax

unread,
Jun 24, 2009, 4:35:42 AM6/24/09
to maven-config-processor-users
Even more if I use full path
<output>${project.build.directory}/my/config.properties</output>
It will throw:
[INFO] Error during config processing
Embedded error: Unable to create directory:...

Leandro de Oliveira

unread,
Jun 24, 2009, 9:35:11 AM6/24/09
to maven-config-p...@googlegroups.com
If you want to set the output directory to something different from
${project.build.directory} (which is the default value for
"outputDirectory"), you should set "useOutputDirectory" to false.

The example is wrong, thanks for pointing it out, it is correct now.

2009/6/24 omax <lyst...@gmail.com>:

omax

unread,
Jun 26, 2009, 5:42:43 AM6/26/09
to maven-config-processor-users
Thanks it works now.
Although I don't find it good that <output> is not checked if absolute
path specified and it then should ignore appending output directory
itself.

On Jun 24, 4:35 pm, Leandro de Oliveira <lehph...@gmail.com> wrote:
> If you want to set the output directory to something different from
> ${project.build.directory} (which is the default value for
> "outputDirectory"), you should set "useOutputDirectory" to false.
>
> The example is wrong, thanks for pointing it out, it is correct now.
>
> 2009/6/24 omax <lystoc...@gmail.com>:

Leandro de Oliveira

unread,
Jun 26, 2009, 9:27:36 AM6/26/09
to maven-config-p...@googlegroups.com
Hi,

Maven projects should not rely on absolute paths to execute builds
because they can be too dependent on the environment they are running.
So, it is advised to always use paths relative to the directory
containing the pom.xml file.
We use the project output directory by default so that you don't have
to prepend ${project.build.directory} to every transformation you want
to execute. It is useful when there are more than a few
transformations to perform.

Glad it is working for you.

2009/6/26 omax <lyst...@gmail.com>:

omax

unread,
Jul 3, 2009, 4:35:49 AM7/3/09
to maven-config-processor-users
Sorry but I think in most plugins for maven absolute paths are
recognized correctly.
Anyway please correct the example:
<output>target/processed-files/my-config.properties</output>
as this doesn't look nice:
target/target/..

On Jun 26, 4:27 pm, Leandro de Oliveira <lehph...@gmail.com> wrote:
> Hi,
>
> Maven projects should not rely on absolute paths to execute builds
> because they can be too dependent on the environment they are running.
> So, it is advised to always use paths relative to the directory
> containing the pom.xml file.
> We use the project output directory by default so that you don't have
> to prepend ${project.build.directory} to every transformation you want
> to execute. It is useful when there are more than a few
> transformations to perform.
>
> Glad it is working for you.
>
> 2009/6/26 omax <lystoc...@gmail.com>:

Leandro de Oliveira

unread,
Jul 3, 2009, 7:46:56 PM7/3/09
to maven-config-p...@googlegroups.com
I've updated the example to not use "target".
Thanks.

2009/7/3 omax <lyst...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages