kriegaex commented on PR #123:
URL: https://github.com/apache/xalan-java/pull/123#issuecomment-1815654883

   > We have a few files that need to be filtered to insert version info, 
currently saved as `whatever.src`. The Ant build filtered them into 
`whatever.java`. Looking at Maven filtering, I don't see a filter-and-copy 
operation that would work for these. Am I missing something, or do I have to 
check the raw version in as `.java` so they get filtered properly, or...?
   
   Let us deal with that after merging the XALANJ-2709 PR. Some basic thoughts:
     * Why make matters complicated by using a different file extension? Just 
name the resource file like the final file and let a filtering plugin do the 
rest.
     * For filtering source code, there is [Templating Maven 
Plugin](https://www.mojohaus.org/templating-maven-plugin/). I never used it 
before, but the basic idea is that it both filters and copies the file, but 
usually from _src/main/java-templates_ to 
_target/generated-sources/java-templates_. Then the latter is added as a source 
folder. That would work just fine in a Maven build, but how well it would be 
understood by an IDE is to be tested.
     * I would use a completely different approach, which is much simpler and 
avoids having to commit your Java files, just because version numbers have to 
be baked into them: Let the Java files read those version numbers from a 
properties or other type of resource file. That is standardised and easy to 
handle with resource filtering.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org
For additional commands, e-mail: dev-h...@xalan.apache.org

Reply via email to