[ 
https://issues.apache.org/jira/browse/DERBY-4341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834064#action_12834064
 ] 

John Storta Jr. commented on DERBY-4341:
----------------------------------------

Thanks Bryan.

I modified the runmessagecheck target to fork a java process.  Since this was 
no longer a taskdef running within the ant process, I had to modify the 
MessageBundleTest.java source so that it no longer extends 
org.apache.tools.ant.Task.  This meant changing the execute method to a 
standard main method.

I also changed it to throw a basic Exception rather than a 
org.apache.tools.ant.BuildException.  Since it no longer runs in the ant 
environment, it does not have visibility to the ant classpath.

Now when you run ant -v runmessagecheck, you get consistent results whether or 
not you have CLASSPATH set.  I also tested it with and without an extra message.

The only downside I see is that there are some extra lines of output, 
especially when it finds an extra message and throws the exception. The results 
seem to get lost in the output.

I've attached a diff showing the changes I made from Revision 910374.

I am new to all of this so if I am off in the weeds on my solution or not 
following the correct process for posting it, let me know.

> Building with ant all with a different CLASSPATH defined causes the build to 
> fail
> ---------------------------------------------------------------------------------
>
>                 Key: DERBY-4341
>                 URL: https://issues.apache.org/jira/browse/DERBY-4341
>             Project: Derby
>          Issue Type: Bug
>          Components: Build tools
>    Affects Versions: 10.6.0.0
>            Reporter: Tiago R. Espinha
>            Assignee: John Storta Jr.
>
> The problem happens when we are trying to compile the source code in a folder 
> and have the CLASSPATH variable set to a different code tree folder. This 
> results in compile failures like the following:
> runmessagecheck:
> [runMessageBundleTest] WARNING: Message id 22011.S.1 in 
> messages_en.properties is not referenced in either SQLState.java or 
> MessageId.java
> [runMessageBundleTest] WARNING: Message id 42Y03.S.0 in 
> messages_en.properties is not referenced in either SQLState.java or 
> MessageId.java
> [runMessageBundleTest] WARNING: Message id 42Y03.S.1 in 
> messages_en.properties is not referenced in either SQLState.java or 
> MessageId.java
> [runMessageBundleTest] WARNING: Message id 42Y03.S.2 in 
> messages_en.properties is not referenced in either SQLState.java or 
> MessageId.java
> BUILD FAILED
> /home/tiago/Desktop/DerbyStuff/CodeTenFiveTwo/build.xml:514: Message check 
> failed. 
> See error in build output or call ant runmessagecheck.
> Total time: 1 minute 11 seconds
> This should be an easy fix and it is marked as a bug, since it doesn't seem 
> very logical for the compiling process to be CLASSPATH-dependent. Note that 
> unsetting the CLASSPATH altogether allows the compile to run without errors, 
> so clearly this variable isn't needed and shouldn't be used when it is set.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to