You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Andreas Hartmann <an...@apache.org> on 2009/01/28 15:16:40 UTC

Provide version-independent command(s) to start launchpad?

Hi Sling devs,

according to the website the following command has to be used to start 
the launchpad:

   java -jar 
target/org.apache.sling.launchpad.app-2.0.0-incubator-SNAPSHOT.jar -c 
sling -f -

Since it includes the version number, one has to change the command to 
fit the current version, or you'd have to update the website continuously.

Would it make sense to provide version-independent commands, e.g. 
sling.sh and sling.bat? Or maybe it's possible to use Maven for this 
purpose (I'm not familiar yet with the Maven capabilities)?

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


Re: Provide version-independent command(s) to start launchpad?

Posted by Andreas Hartmann <an...@apache.org>.
Carsten Ziegeler schrieb:
> Andreas Hartmann wrote:
>> Hi Sling devs,
>>
>> according to the website the following command has to be used to start
>> the launchpad:
>>
>>   java -jar
>> target/org.apache.sling.launchpad.app-2.0.0-incubator-SNAPSHOT.jar -c
>> sling -f -
>>
>> Since it includes the version number, one has to change the command to
>> fit the current version, or you'd have to update the website continuously.
>>
>> Would it make sense to provide version-independent commands, e.g.
>> sling.sh and sling.bat? Or maybe it's possible to use Maven for this
>> purpose (I'm not familiar yet with the Maven capabilities)?
>>
> We could use the finalName configuration (for the app and the webapp),
> this ensures that the artifact in the target dir has always the same
> name - this doesn't affect the name in the repo.

Thanks for the pointer!
Do you mean something like this?


Index: launchpad/app/pom.xml
===================================================================
--- launchpad/app/pom.xml	(revision 738488)
+++ launchpad/app/pom.xml	(working copy)
@@ -44,6 +44,7 @@
      </scm>

      <build>
+        <finalName>org.apache.sling.launchpad.app</finalName>
          <plugins>
              <!-- Bundles to list in the installer properties file -->
              <plugin>


This seems to work for me.

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


Re: Provide version-independent command(s) to start launchpad?

Posted by Carsten Ziegeler <cz...@apache.org>.
Andreas Hartmann wrote:
> Hi Sling devs,
> 
> according to the website the following command has to be used to start
> the launchpad:
> 
>   java -jar
> target/org.apache.sling.launchpad.app-2.0.0-incubator-SNAPSHOT.jar -c
> sling -f -
> 
> Since it includes the version number, one has to change the command to
> fit the current version, or you'd have to update the website continuously.
> 
> Would it make sense to provide version-independent commands, e.g.
> sling.sh and sling.bat? Or maybe it's possible to use Maven for this
> purpose (I'm not familiar yet with the Maven capabilities)?
> 
We could use the finalName configuration (for the app and the webapp),
this ensures that the artifact in the target dir has always the same
name - this doesn't affect the name in the repo.

WDYT?
Carsten

-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Provide version-independent command(s) to start launchpad?

Posted by Carsten Ziegeler <cz...@apache.org>.
Felix Meschberger wrote:
> 
> I agree with respect to webapps -- webapps are to be deployed into
> whatever container is available.
>
Maven has some support (plugin) to generate the start scripts with
everything one needs.
Archiva and Continuum are using this for instance.
I can't remember out of my head how, but I'll look it up.

Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Provide version-independent command(s) to start launchpad?

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Bertrand Delacretaz schrieb:
> On Wed, Jan 28, 2009 at 4:55 PM, Felix Meschberger <fm...@gmail.com> wrote:
> 
>>> …/launchpad/app/src/main/dist/unix/serverctl: line 313:
>>> $SLING_CONTEXT/bin/${project.build.finalName}.jar: bad substitution...
> 
>> ...On a similar recount: I think, these scripts would need some work, in
>> other works made simpler. Esp. the unix shell script is much too
>> complicated IMHO.
> 
> I suggest removing those scripts - there are much better utilities
> around to start runnable jars or webapps, I think that's outside of
> Sling's scope.

I agree with respect to webapps -- webapps are to be deployed into
whatever container is available.

With respect to the standalone Jar, I think it would be nice to have a
set of very simple scripts to launch sling. With "simple" I mean the
kind thing:

   #!/bin/sh
   JAVA_HOME=... find it out ...
   ${JAVA_HOME}/bin/java -jar path/to/sling.jar $@

or slightly more elaborate to also enable debugging by a simple command
line argument.

But for the short term, I agree, the scripts should be removed.

Regards
Felix


Re: Provide version-independent command(s) to start launchpad?

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Wed, Jan 28, 2009 at 5:46 PM, Jim White <ji...@pagesmiths.com> wrote:
> ...Of course an executable JAR is even better if it suits the application...

The launchpad/app jar is executable, you don't need ant to run it.

-Bertrand

Re: Provide version-independent command(s) to start launchpad?

Posted by Jim White <ji...@pagesmiths.com>.
Bertrand Delacretaz wrote:

> On Wed, Jan 28, 2009 at 4:55 PM, Felix Meschberger <fm...@gmail.com> wrote:
> 
>>>…/launchpad/app/src/main/dist/unix/serverctl: line 313:
>>>$SLING_CONTEXT/bin/${project.build.finalName}.jar: bad substitution...
> 
>>...On a similar recount: I think, these scripts would need some work, in
>>other works made simpler. Esp. the unix shell script is much too
>>complicated IMHO.
> 
> I suggest removing those scripts - there are much better utilities
> around to start runnable jars or webapps, I think that's outside of
> Sling's scope.

Yeah.  I've frequently argued that an Ant script is almost always the 
right way to run Java cross-platform.  Not only does it have some of the 
best launch scripts (it will figure out JAVA_HOME in most any 
situation), but Ant is frequently already installed (like on Mac) or 
just an apt-get or rpm away.

Of course an executable JAR is even better if it suits the application.

Jim


Re: Provide version-independent command(s) to start launchpad?

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Wed, Jan 28, 2009 at 4:55 PM, Felix Meschberger <fm...@gmail.com> wrote:

>> …/launchpad/app/src/main/dist/unix/serverctl: line 313:
>> $SLING_CONTEXT/bin/${project.build.finalName}.jar: bad substitution...

> ...On a similar recount: I think, these scripts would need some work, in
> other works made simpler. Esp. the unix shell script is much too
> complicated IMHO.

I suggest removing those scripts - there are much better utilities
around to start runnable jars or webapps, I think that's outside of
Sling's scope.

-Bertrand

Re: Provide version-independent command(s) to start launchpad?

Posted by Felix Meschberger <fm...@gmail.com>.
Hi Andreas,

Andreas Hartmann schrieb:
> Andreas Hartmann schrieb:
> 
> […]
> 
>> Would it make sense to provide version-independent commands, e.g.
>> sling.sh and sling.bat?
> 
> I just noticed that there are server control commands in
> launchpad/app/src/main/dist/windows and …/unix. Are they meant for the
> purpose I mentioned? Unfortunately the unix commands don't work on the Mac:
> 
> …/launchpad/app/src/main/dist/unix/serverctl: line 313:
> $SLING_CONTEXT/bin/${project.build.finalName}.jar: bad substitution
> 
> …/launchpad/app/src/main/dist/unix/serverctl: line 410: $SLING_JVM
> $jvmOpts -jar $SLING_CONTEXT/bin/${project.build.finalName}.jar
> $slingOpts: bad substitution

IIRC these are meant to be copied (and filtered) by the assembly profile
when build app.

On a similar recount: I think, these scripts would need some work, in
other works made simpler. Esp. the unix shell script is much too
complicated IMHO.

Regards
Felix


Re: Provide version-independent command(s) to start launchpad?

Posted by Andreas Hartmann <an...@apache.org>.
Andreas Hartmann schrieb:

[…]

> Would it make sense to provide version-independent commands, e.g. 
> sling.sh and sling.bat?

I just noticed that there are server control commands in 
launchpad/app/src/main/dist/windows and …/unix. Are they meant for the 
purpose I mentioned? Unfortunately the unix commands don't work on the Mac:

…/launchpad/app/src/main/dist/unix/serverctl: line 313: 
$SLING_CONTEXT/bin/${project.build.finalName}.jar: bad substitution

…/launchpad/app/src/main/dist/unix/serverctl: line 410: $SLING_JVM 
$jvmOpts -jar $SLING_CONTEXT/bin/${project.build.finalName}.jar 
$slingOpts: bad substitution


-- Andreas



-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01