You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2009/01/05 21:41:26 UTC

DO NOT REPLY [Bug 46480] New: Running SQL Task inside Maven Ant-Run prevents logging for subsequent tasks

https://issues.apache.org/bugzilla/show_bug.cgi?id=46480

           Summary: Running SQL Task inside Maven Ant-Run prevents logging
                    for subsequent tasks
           Product: Ant
           Version: 1.7.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: brian.bonner@paraware.com


This used to work with version 1.6.5.

I'm using Maven 2.0.9.  When I use the ant-run plugin, it used to log tasks
after an SQL task was specified without any problem.  Upgrading to 1.7.0 or
1.7.1 breaks this functionality.

<profiles>
                <profile>
                        <id>createdb</id>
                        <build>
                                <plugins>
                                        <plugin>
                                               
<groupId>org.apache.maven.plugins</groupId>
                                               
<artifactId>maven-antrun-plugin</artifactId>
                                                <version>1.3</version>
                                                <configuration>
                                                        <tasks>
                                                                <echo>test
before sql</echo>
                                                                <sql
driver="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@localhost:1521:XE"
userid="test" password="test" autocommit="false" delimiter=";"
onerror="continue" >
                                                                       
<transaction
                                                                               
src="${basedir}/ddl/test.dev.sql" />
                                                                </sql>
<echo>test after sql</echo>
                                                        </tasks>
                                                </configuration>
                                                <executions>
                                                        <execution>
                                                                <id>create
database</id>
                                                               
<phase>install</phase>
                                                                <goals>
                                                                       
<goal>run</goal>
                                                                </goals>
                                                        </execution>
                                                </executions>
                                                <dependencies>
                                                        <dependency>
                                                               
<groupId>ojdbc</groupId>
                                                               
<artifactId>ojdbc</artifactId>
                                                               
<version>1.4</version>
                                                        </dependency>
                                                </dependencies>
                                        </plugin>
                                </plugins>
                        </build>
                </profile>

With 1.6.5, I see this:

[INFO] Executing tasks
     [echo] test before sql
      [sql] Executing file:
C:\work\workspace\OptimizerWebData\sql\01_optmzr_pro
d.sql
      [sql] 4252 of 4252 SQL statements executed successfully
     [echo] test after sql

With 1.7.1, I see this:

[INFO] Executing tasks
     [echo] test before sql
      [sql] Executing file:
C:\work\workspace\OptimizerWebData\sql\01_optmzr_pro
d.sql
      [sql] 4252 of 4252 SQL statements executed successfully
     [echo] test after sql


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46480] Running SQL Task inside Maven Ant-Run prevents logging for subsequent tasks

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46480


J.M. (Martijn) Kruithof <jk...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |plitwak@hotmail.com




--- Comment #12 from J.M. (Martijn) Kruithof <jk...@apache.org>  2009-03-28 01:21:28 PST ---
*** Bug 46931 has been marked as a duplicate of this bug. ***

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 46480] Running SQL Task inside Maven Ant-Run prevents logging for subsequent tasks

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46480





--- Comment #2 from Brian Bonner <br...@paraware.com>  2009-01-06 04:53:17 PST ---
Stefan, sorry about that.  Thanks for your msg.  I was too quick with the post.

With 1.7.1, I see this:

[INFO] Executing tasks
     [echo] test before sql
      [sql] Executing file:
C:\work\workspace\OptimizerWebData\sql\01_optmzr_pro
d.sql

I don't see the # of statements executed or the second echo.  I had pulled down
the source for 1.7.1 ant to debug this and see the print stream created and see
the methods being called in the code (they all have a priority of 2), but for
some reason the last two statements are not printing.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46480] Running SQL Task inside Maven Ant-Run prevents logging for subsequent tasks

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46480





--- Comment #6 from Brian Bonner <br...@paraware.com>  2009-01-13 09:54:42 PST ---
Stefan, my apologies for the delay in getting back to you.

I don't think I tried 1.7.0.  I bet that does fix the problem.  I'll try it
right now.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 46480] Running SQL Task inside Maven Ant-Run prevents logging for subsequent tasks

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46480


Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |notifications@ant.apache.org
         AssignedTo|notifications@ant.apache.org|bodewig@apache.org
   Target Milestone|---                         |1.8.0




--- Comment #3 from Stefan Bodewig <bo...@apache.org>  2009-01-06 06:17:56 PST ---
Have you actually tried 1.7.0 as well?  I think I've spotted the problem, but
if I do, it has been introduced with svn revision 551166 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=551166 ) which went into 1.7.1
but not into 1.7.0.

In the execute method there is a finally block that looks like

                } finally {
                    FileUtils.close(out);
                }

in 1.7.1.  Can you change it to read

                } finally {
                    if (out != System.out) {
                        FileUtils.close(out);
                    }
                }

and somehow make maven use your patched code to verify this is causing
the problem?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are the assignee for the bug.

DO NOT REPLY [Bug 46480] Running SQL Task inside Maven Ant-Run prevents logging for subsequent tasks

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46480


Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




--- Comment #8 from Stefan Bodewig <bo...@apache.org>  2009-01-14 04:53:43 PST ---
Hi Brian, I'm glad 1.7.0 was an option for you.

Under http://people.apache.org/~bodewig/ant.jar you find a patched ant.jar
built from the Ant 1.7.1 tag but with my patch to trunk backported.  This is
certainly no real release ...

Still it would be good if you could verify that it doesn't expose the same
problem as 1.7.1.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 46480] Running SQL Task inside Maven Ant-Run prevents logging for subsequent tasks

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46480





--- Comment #4 from Stefan Bodewig <bo...@apache.org>  2009-01-06 06:28:00 PST ---
Actually, my proposed fix would be svn revision 731951 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=731951 )


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 46480] Running SQL Task inside Maven Ant-Run prevents logging for subsequent tasks

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46480


Brian Bonner <br...@paraware.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #7 from Brian Bonner <br...@paraware.com>  2009-01-13 09:58:31 PST ---
1.7.0 did the trick.  So you nailed the problem.  I'll try a patched jar if you
send it on over -- that would be great!  Thanks for your help -- and looking
into the problem.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 46480] Running SQL Task inside Maven Ant-Run prevents logging for subsequent tasks

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46480





--- Comment #9 from Stefan Bodewig <bo...@apache.org>  2009-01-26 21:10:22 PST ---
any news on my patched jar?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 46480] Running SQL Task inside Maven Ant-Run prevents logging for subsequent tasks

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46480





--- Comment #11 from Stefan Bodewig <bo...@apache.org>  2009-02-19 07:48:38 PST ---
no problem at all, thanks for testing.

I can now safely remove ant.jar from my people.a.o directory.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 46480] Running SQL Task inside Maven Ant-Run prevents logging for subsequent tasks

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46480





--- Comment #5 from Stefan Bodewig <bo...@apache.org>  2009-01-12 04:29:27 PST ---
Brian, is there anything I can do to help testing - like providing a patched
version of ant-1.7.1.jar that you could put into your local Maven repository or
something?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 46480] Running SQL Task inside Maven Ant-Run prevents logging for subsequent tasks

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46480





--- Comment #1 from Stefan Bodewig <bo...@apache.org>  2009-01-05 22:12:34 PST ---
I'm not familiar with the antrun plugin at all, and I don't really have a
working Maven installation around either, so I may need some help debugging
this.

But first things first, where is the difference between the two outputs?  I
guess you've just pasted the wrong output for the 1.7.1 run.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46480] Running SQL Task inside Maven Ant-Run prevents logging for subsequent tasks

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46480


Brian Bonner <br...@paraware.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




--- Comment #10 from Brian Bonner <br...@paraware.com>  2009-02-19 07:01:45 PST ---
Stefan, it works fine.  I'm sorry for taking so long to get back to you.  Thank
you for the help.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.