Solr
  1. Solr
  2. SOLR-6926

"ant example" makes no sense anymore - should be "ant server" (or refactored into some other compilation realted target)

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0
    • Component/s: None
    • Labels:
      None

      Description

      (filing as followup to a chat i had with tim offline the other day)

      the ant target "ant example" doesn't really make any sense anymore ... that name was created way, way, back when "ant compile" built up the dist/solr.war file that people were expected to "install" and "ant example" took care of copying that war file into the example/jetty directory

      these days, it should probably be named something like "ant server" or refactored inside an existing task like "ant compile"

        Activity

        Hide
        Ramkumar Aiyengar added a comment -

        I had a patch put up on the original stop shipping war which never got in, could be useful..

        https://github.com/apache/lucene-solr/pull/112

        Show
        Ramkumar Aiyengar added a comment - I had a patch put up on the original stop shipping war which never got in, could be useful.. https://github.com/apache/lucene-solr/pull/112
        Hide
        ASF subversion and git services added a comment -

        Commit 1651535 from Timothy Potter in branch 'dev/trunk'
        [ https://svn.apache.org/r1651535 ]

        SOLR-6926: remove ant example, now it is ant server

        Show
        ASF subversion and git services added a comment - Commit 1651535 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1651535 ] SOLR-6926 : remove ant example, now it is ant server
        Hide
        ASF subversion and git services added a comment -

        Commit 1651537 from Timothy Potter in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1651537 ]

        SOLR-6926: remove ant example, now it is ant server

        Show
        ASF subversion and git services added a comment - Commit 1651537 from Timothy Potter in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1651537 ] SOLR-6926 : remove ant example, now it is ant server
        Hide
        ASF subversion and git services added a comment -

        Commit 1651698 from Timothy Potter in branch 'dev/trunk'
        [ https://svn.apache.org/r1651698 ]

        SOLR-6926: Add example target with gentle prompt to start using ant server instead

        Show
        ASF subversion and git services added a comment - Commit 1651698 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1651698 ] SOLR-6926 : Add example target with gentle prompt to start using ant server instead
        Hide
        ASF subversion and git services added a comment -

        Commit 1651699 from Timothy Potter in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1651699 ]

        SOLR-6926: Add example target with gentle prompt to start using ant server instead

        Show
        ASF subversion and git services added a comment - Commit 1651699 from Timothy Potter in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1651699 ] SOLR-6926 : Add example target with gentle prompt to start using ant server instead
        Hide
        ASF subversion and git services added a comment -

        Commit 1651706 from Timothy Potter in branch 'dev/branches/lucene_solr_5_0'
        [ https://svn.apache.org/r1651706 ]

        SOLR-6926: Add example target with gentle prompt to start using ant server instead

        Show
        ASF subversion and git services added a comment - Commit 1651706 from Timothy Potter in branch 'dev/branches/lucene_solr_5_0' [ https://svn.apache.org/r1651706 ] SOLR-6926 : Add example target with gentle prompt to start using ant server instead
        Hide
        Ishan Chattopadhyaya added a comment -

        While running "ant server", I was somehow hoping it would start a "server", which actually needs an "ant run-example" separately.

        1. Shouldn't "ant server" also start the server (like "ant run-example"), whereas something like "ant build-server" or "ant compile-server" do what "ant example" used to do (and "ant server" currently does)?
        2. Even if we don't want to do point 1, shouldn't we want to rename "ant run-example" to "ant run-server"?

        Show
        Ishan Chattopadhyaya added a comment - While running "ant server", I was somehow hoping it would start a "server", which actually needs an "ant run-example" separately. 1. Shouldn't "ant server" also start the server (like "ant run-example"), whereas something like "ant build-server" or "ant compile-server" do what "ant example" used to do (and "ant server" currently does)? 2. Even if we don't want to do point 1, shouldn't we want to rename "ant run-example" to "ant run-server"?
        Hide
        Shawn Heisey added a comment -

        While running "ant server", I was somehow hoping it would start a "server", which actually needs an "ant run-example" separately.

        I don't think it should be possible to start Solr this way at all. The ant program is a build tool. Once the server is built, the bin/solr script can (and should) be used to start Solr.

        SOLR-854 is where run-example was added, way back before 1.4 was released. Although I think ant is the wrong place to start Solr, If Mark Miller thinks that we should have run-server, I won't stand in the way. It should be its own issue, though.

        Show
        Shawn Heisey added a comment - While running "ant server", I was somehow hoping it would start a "server", which actually needs an "ant run-example" separately. I don't think it should be possible to start Solr this way at all. The ant program is a build tool. Once the server is built, the bin/solr script can (and should) be used to start Solr. SOLR-854 is where run-example was added, way back before 1.4 was released. Although I think ant is the wrong place to start Solr, If Mark Miller thinks that we should have run-server, I won't stand in the way. It should be its own issue, though.
        Hide
        Mark Miller added a comment -

        ant is not a good way for a user to start Solr, but it's invaluable if your a dev. I don't care what it's called though.

        Show
        Mark Miller added a comment - ant is not a good way for a user to start Solr, but it's invaluable if your a dev. I don't care what it's called though.
        Hide
        Ramkumar Aiyengar added a comment -

        I agree with Shawn that the primary purpose of ant is to be a build tool, and hence it makes sense for ant server to just build. It's a nice convenience to have a target to build and run for developers, and that's what run-example does. That is actually running an example (calls solr -e techproducts ...) and not any server, so the name still makes sense..

        Show
        Ramkumar Aiyengar added a comment - I agree with Shawn that the primary purpose of ant is to be a build tool, and hence it makes sense for ant server to just build. It's a nice convenience to have a target to build and run for developers, and that's what run-example does. That is actually running an example (calls solr -e techproducts ... ) and not any server, so the name still makes sense..
        Hide
        Uwe Schindler added a comment -

        In addition, "ant run-example" is broken on windows, which makes development harder for me:

        run-example:
        
        BUILD FAILED
        C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr1\solr\build.xml:66: Execute failed: java.io.IOException: Cannot run program "C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr1\solr\bin\solr": CreateProcess error=193, %1 ist keine zulässige Win32-Anwendung
                at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
                at java.lang.Runtime.exec(Runtime.java:620)
                at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
                at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
                at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
                at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:631)
                at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:672)
                at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:498)
                at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
                at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:483)
                at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
                at org.apache.tools.ant.Task.perform(Task.java:348)
                at org.apache.tools.ant.Target.execute(Target.java:392)
                at org.apache.tools.ant.Target.performTasks(Target.java:413)
                at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
                at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
                at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
                at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
                at org.apache.tools.ant.Main.runBuild(Main.java:811)
                at org.apache.tools.ant.Main.startAnt(Main.java:217)
                at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
                at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
        Caused by: java.io.IOException: CreateProcess error=193, %1 ist keine zulõssige Win32-Anwendung
                at java.lang.ProcessImpl.create(Native Method)
                at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
                at java.lang.ProcessImpl.start(ProcessImpl.java:137)
                at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
                ... 23 more
        
        Total time: 4 minutes 0 seconds
        

        I think the problem is that the ant task should use "solr.cmd" if it detects windows.

        Show
        Uwe Schindler added a comment - In addition, "ant run-example" is broken on windows, which makes development harder for me: run-example: BUILD FAILED C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr1\solr\build.xml:66: Execute failed: java.io.IOException: Cannot run program "C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr1\solr\bin\solr": CreateProcess error=193, %1 ist keine zulässige Win32-Anwendung at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at java.lang.Runtime.exec(Runtime.java:620) at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862) at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481) at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495) at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:631) at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:672) at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:498) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:392) at org.apache.tools.ant.Target.performTasks(Target.java:413) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) at org.apache.tools.ant.Project.executeTarget(Project.java:1368) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1251) at org.apache.tools.ant.Main.runBuild(Main.java:811) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Caused by: java.io.IOException: CreateProcess error=193, %1 ist keine zulõssige Win32-Anwendung at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(ProcessImpl.java:386) at java.lang.ProcessImpl.start(ProcessImpl.java:137) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 23 more Total time: 4 minutes 0 seconds I think the problem is that the ant task should use "solr.cmd" if it detects windows.
        Hide
        Uwe Schindler added a comment -

        It is also strange that the run-example target depends on "server", but then runs the example the old way (failing to do so on Windows).

        Show
        Uwe Schindler added a comment - It is also strange that the run-example target depends on "server", but then runs the example the old way (failing to do so on Windows).
        Hide
        Uwe Schindler added a comment -
        {source:xml}
        <exec executable="${common-solr.dir}/bin/solr" failonerror="true">
        <arg line="-e techproducts -p ${example.jetty.port} -m ${example.heap.size} -d ${server.dir} -a '${example.jvm.line}'"/>
        </exec>{source}

        This is also likely to break on systems with whitespace. Never-ever use <arg line="..."/>. The correct way is multiple <arg value="..."/> elements for every parameter.

        Show
        Uwe Schindler added a comment - {source:xml} <exec executable="${common-solr.dir}/bin/solr" failonerror="true"> <arg line="-e techproducts -p ${example.jetty.port} -m ${example.heap.size} -d ${server.dir} -a '${example.jvm.line}'"/> </exec>{source} This is also likely to break on systems with whitespace. Never-ever use <arg line="..."/>. The correct way is multiple <arg value="..."/> elements for every parameter.
        Hide
        ASF subversion and git services added a comment -

        Commit 1653806 from Uwe Schindler in branch 'dev/trunk'
        [ https://svn.apache.org/r1653806 ]

        SOLR-6926: Fix at least "run-example" script to work on Windows and dont use <arg line=""/> in ANT. It currently does not work when booting example if path contains spaces!

        Show
        ASF subversion and git services added a comment - Commit 1653806 from Uwe Schindler in branch 'dev/trunk' [ https://svn.apache.org/r1653806 ] SOLR-6926 : Fix at least "run-example" script to work on Windows and dont use <arg line=""/> in ANT. It currently does not work when booting example if path contains spaces!
        Hide
        Timothy Potter added a comment -

        I'm not working on this and am not sure what work remains so un-assigning ...

        Show
        Timothy Potter added a comment - I'm not working on this and am not sure what work remains so un-assigning ...
        Hide
        David Smiley added a comment -

        Shall we remove the "example" task now that 6.0 is on the way? I think so. It prints a loud notice it's going away and to use ant server instead.

        As an aside, I suggest we always use the exact string "Deprecated" so we can more easily find things we should be removing prior to a major release.

        Show
        David Smiley added a comment - Shall we remove the "example" task now that 6.0 is on the way? I think so. It prints a loud notice it's going away and to use ant server instead. As an aside, I suggest we always use the exact string "Deprecated" so we can more easily find things we should be removing prior to a major release.
        Hide
        David Smiley added a comment -

        I will do so, to include the 6.0 release branch tonight. It's a trival change to simply remove the ant target.

        Show
        David Smiley added a comment - I will do so, to include the 6.0 release branch tonight. It's a trival change to simply remove the ant target.
        Hide
        ASF subversion and git services added a comment -

        Commit 143379d9de3a02c83f234f7abae0f75a9cd4689c in lucene-solr's branch refs/heads/branch_6_0 from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=143379d ]

        SOLR-6926: Remove deprecated "ant example"; replaced by "ant server" a year ago
        (cherry picked from commit 16d9889)

        Show
        ASF subversion and git services added a comment - Commit 143379d9de3a02c83f234f7abae0f75a9cd4689c in lucene-solr's branch refs/heads/branch_6_0 from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=143379d ] SOLR-6926 : Remove deprecated "ant example"; replaced by "ant server" a year ago (cherry picked from commit 16d9889)
        Hide
        ASF subversion and git services added a comment -

        Commit 16d98894ed41992eb5cfd5de11ae1e2ee72b97c9 in lucene-solr's branch refs/heads/branch_6x from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=16d9889 ]

        SOLR-6926: Remove deprecated "ant example"; replaced by "ant server" a year ago
        (cherry picked from commit a0a571c)

        Show
        ASF subversion and git services added a comment - Commit 16d98894ed41992eb5cfd5de11ae1e2ee72b97c9 in lucene-solr's branch refs/heads/branch_6x from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=16d9889 ] SOLR-6926 : Remove deprecated "ant example"; replaced by "ant server" a year ago (cherry picked from commit a0a571c)
        Hide
        ASF subversion and git services added a comment -

        Commit a0a571caa9777a8a6401b88ff9c4d2bb982055b8 in lucene-solr's branch refs/heads/master from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a0a571c ]

        SOLR-6926: Remove deprecated "ant example"; replaced by "ant server" a year ago

        Show
        ASF subversion and git services added a comment - Commit a0a571caa9777a8a6401b88ff9c4d2bb982055b8 in lucene-solr's branch refs/heads/master from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a0a571c ] SOLR-6926 : Remove deprecated "ant example"; replaced by "ant server" a year ago
        Hide
        David Smiley added a comment -

        Marking as closed to 5.0 which is when the work really happened.

        Show
        David Smiley added a comment - Marking as closed to 5.0 which is when the work really happened.
        Hide
        ASF subversion and git services added a comment -

        Commit 6177320ae3d258b9853710740f1c7da209cd72fc in lucene-solr's branch refs/heads/branch_6_0 from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6177320 ]

        SOLR-6926: fix smokeTestRelease.py to stop calling ant example.
        (cherry picked from commit 7c69f27)

        Show
        ASF subversion and git services added a comment - Commit 6177320ae3d258b9853710740f1c7da209cd72fc in lucene-solr's branch refs/heads/branch_6_0 from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6177320 ] SOLR-6926 : fix smokeTestRelease.py to stop calling ant example. (cherry picked from commit 7c69f27)
        Hide
        ASF subversion and git services added a comment -

        Commit 7c69f272337fb16d7aea0995aed48d19ff62b1ec in lucene-solr's branch refs/heads/branch_6x from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=7c69f27 ]

        SOLR-6926: fix smokeTestRelease.py to stop calling ant example.
        (cherry picked from commit e490b32)

        Show
        ASF subversion and git services added a comment - Commit 7c69f272337fb16d7aea0995aed48d19ff62b1ec in lucene-solr's branch refs/heads/branch_6x from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=7c69f27 ] SOLR-6926 : fix smokeTestRelease.py to stop calling ant example. (cherry picked from commit e490b32)
        Hide
        ASF subversion and git services added a comment -

        Commit e490b329b3a6553720f3b422ce4422153baabad9 in lucene-solr's branch refs/heads/master from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=e490b32 ]

        SOLR-6926: fix smokeTestRelease.py to stop calling ant example.

        Show
        ASF subversion and git services added a comment - Commit e490b329b3a6553720f3b422ce4422153baabad9 in lucene-solr's branch refs/heads/master from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=e490b32 ] SOLR-6926 : fix smokeTestRelease.py to stop calling ant example.

          People

          • Assignee:
            Unassigned
            Reporter:
            Hoss Man
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development