Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
[deleted comment]
[deleted comment]
[deleted comment]
[deleted comment]
[deleted comment]
[deleted comment]
Possible pom configuration may be:
<plugin>
<groupId>bakersoftware</groupId>
<artifactId>maven-replacer-plugin</artifactId>
<version>x.x.x</version>
<executions>
<execution>
<phase>prepare-package</phase>
<configuration>
<files>
<file>
<name>target/someapp/jsp/header.jsp</file>
<regex>false</regex>
<token>$BUILD_NUMBER$</token>
<value>${buildNumber}</value>
</file>
<file>
<name>target/someapp/database.properties</file>
<token>database url</token>
<value>jdbc:postgresql:database</value>
</file>
...
</files>
</configuration>
</execution>
</executions>
</plugin>
However, the tag "files" may not be a good name.
If anyone sees any issues with this, please comment.
Original comment by baker.st...@gmail.com
on 6 Oct 2009 at 11:07
How about:
<configuration>
<files path="target/generated-sources" includes="**/*.java">
<token regexp="true">^(.+) class</token>
<value>$1_foo class</value>
<output-file>$path/$1_foo.java</output-file> (or some default pattern slicing the
input file into pieces.. maybe $path $file $ext etc..)
</files>
</configuration>
Original comment by kut...@gmail.com
on 13 Oct 2009 at 9:42
I'm not sure you can specify attributes on elements in a maven plugin.
I'm having trouble digging up anything that might indicate you can do it all.
:-(
Original comment by baker.st...@gmail.com
on 14 Oct 2009 at 7:39
You're right, I didn't think about maven not allowing for attributes on
elements.
How about having <token>foo</token> and
<regexp-token>[1-4].[4-1]</regexp-token>?
Something like this, maybe:
<configuration>
<file>keep this as-is</file>
<files>
<path>target/generated-sources</path>
<includes>**/*.java</includes> (many)
<excludes>...</excludes> (many)
<regex-token>^(.+) class</regex-token> or <token>...</token>
<value>$1_foo class</value>
<output-file>$path/$1_foo.java</output-file>
</files>
</configuration>
And since this is multiple-file support, the <file> and <files> elements would
be
cumulative? i.e. "File X" and "Files in target/foo" and "Files in target/bar
that are
not *.xml" etc...
Original comment by kut...@gmail.com
on 14 Oct 2009 at 3:35
I don't think I can use "-" in element names, but I can simply use "_" or camel
case.
Good suggestions on reducing parametres though, it looks good.
Thanks again :-)
Original comment by baker.st...@gmail.com
on 16 Oct 2009 at 12:54
This issue can be achieved by multiple execution blocks within your pom.xml (as
long
as each block has a unique id).
However, I will keep this task open as this is perhaps not a clean solution.
Original comment by baker.st...@gmail.com
on 12 Nov 2009 at 11:51
Feature implemented in next release.
Original comment by baker.st...@gmail.com
on 20 Dec 2009 at 11:09
Original comment by baker.st...@gmail.com
on 20 Dec 2009 at 11:17
Just issue clean up.
Original comment by baker.st...@gmail.com
on 17 Sep 2012 at 12:39
Original issue reported on code.google.com by
baker.st...@gmail.com
on 6 Oct 2009 at 10:46