You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Will Hoover <ja...@gmail.com> on 2012/07/24 20:41:52 UTC

Filter bug with specified characters in xml comments

I think there is a bug in the way Maven filters resources...

 

If the following file content is filtered it will not replace the property
values with the values in the POM unless the comment line for the
"connection.url" is removed:

 

 

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE hibernate-configuration PUBLIC

          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"

 
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

 

<!-- Generated by MyEclipse Hibernate Tools. -->

<hibernate-configuration>

 

       <session-factory>

       

              <!--

              <property
name="connection.url">jdbc:oracle:thin:@test.example.com:1521:TST</property>

              <property name="connection.username">usr</property>

              <property name="connection.password">testpwd</property>

              -->

 

              <property
name="myeclipse.connection.profile">Oracle-TEST</property>

              <property name="connection.url">${dburl}</property>

              <property name="connection.username">${username}</property>

              <property name="connection.password">${password}</property>

              <property
name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>

              <property
name="dialect">org.hibernate.dialect.Oracle9Dialect</property>

 

              <property name="hibernate.c3p0.min_size">1</property>

              <property name="hibernate.c3p0.max_size">1</property>

              <property name="hibernate.c3p0.timeout">800</property>

              <property name="hibernate.c3p0.max_statements">50</property>

              <property name="hibernate.max_fetch_depth">1</property>

 

              <mapping resource="org/nemours/clab/model/Test.hbm.xml" />

 

       </session-factory>

 

</hibernate-configuration>

 

 

 


Re: Filter bug with specified characters in xml comments

Posted by Aliaksei Lahachou <al...@gmail.com>.
Even if it knew about formats, how would it know that filtering comments is
not what you want? ;)
Am 25.07.2012 15:25 schrieb "Wayne Fay" <wa...@gmail.com>:

> > One might think that it would be ignored due to it being within a
> commented
> > region of the xml, but I guess Maven filtering has no relevance to the
> type
> > of file it's filtering?
>
> Maven Filtering has no knowledge of file types and thus no knowledge
> of comments in one file type vs another. It simply "blindly" tries to
> filter everything it sees.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Filter bug with specified characters in xml comments

Posted by Wayne Fay <wa...@gmail.com>.
> One might think that it would be ignored due to it being within a commented
> region of the xml, but I guess Maven filtering has no relevance to the type
> of file it's filtering?

Maven Filtering has no knowledge of file types and thus no knowledge
of comments in one file type vs another. It simply "blindly" tries to
filter everything it sees.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Filter bug with specified characters in xml comments

Posted by Will Hoover <ja...@gmail.com>.
Thanks for the info Wayne!

One might think that it would be ignored due to it being within a commented region of the xml, but I guess Maven filtering has no relevance to the type of file it's filtering?

-----Original Message-----
From: Wayne Fay [mailto:waynefay@gmail.com] 
Sent: Tuesday, July 24, 2012 3:35 PM
To: Maven Users List
Subject: Re: Filter bug with specified characters in xml comments

> If the following file content is filtered it will not replace the 
> property values with the values in the POM unless the comment line for 
> the "connection.url" is removed:
...
>               <property
> name="connection.url">jdbc:oracle:thin:@test.example.com:1521:TST</pro
> perty>

You are getting tripped up by the @ symbol in your url.

If you don't want to use @...@ as a filter marker token, you need to turn off the defaults in the plugin configuration and then specify your own tokens as a replacement.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Filter bug with specified characters in xml comments

Posted by Wayne Fay <wa...@gmail.com>.
> If the following file content is filtered it will not replace the property
> values with the values in the POM unless the comment line for the
> "connection.url" is removed:
...
>               <property
> name="connection.url">jdbc:oracle:thin:@test.example.com:1521:TST</property>

You are getting tripped up by the @ symbol in your url.

If you don't want to use @...@ as a filter marker token, you need to
turn off the defaults in the plugin configuration and then specify
your own tokens as a replacement.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org