Lift build error....

7 views
Skip to first unread message

Marc Boschma

unread,
May 23, 2007, 10:17:47 PM5/23/07
to lif...@googlegroups.com
This might be mis-placed here, but in attempting to build Lift I got
the following error. Maven etc. is not my strong point... The fact
that Maven installed a second copy of scala makes me suspicious that
Maven might not be the best way to go with getting lift up and
running...

Any clues? Google lead to a whole lot of sites full of XML (bleh :)

Regards,

Marc

Mac:/Volumes/Scratch/src/liftweb/liftweb marc$ mvn -e install
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] Lift
[INFO] Lift Core
[INFO] Lift Example
[INFO] Skittr Example
[INFO]
------------------------------------------------------------------------
----
[INFO] Building Lift
[INFO] task-segment: [install]
[INFO]
------------------------------------------------------------------------
----
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing /Volumes/Scratch/src/liftweb/liftweb/pom.xml to /
Users/marc/.m2/repository/net/liftweb/lift/0.1.8/lift-0.1.8.pom
[INFO]
------------------------------------------------------------------------
----
[INFO] Building Lift Core
[INFO] task-segment: [install]
[INFO]
------------------------------------------------------------------------
----
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [scala:compile {execution: default}]
java.io.IOException: null/bin/java: not found
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:52)
at java.lang.ProcessImpl.start(ProcessImpl.java:91)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
at java.lang.Runtime.exec(Runtime.java:591)
at java.lang.Runtime.exec(Runtime.java:507)
at iodp.usio.CommandMojo.runCommand(CommandMojo.java:57)
at iodp.usio.ScalaCompileMojo.execute(ScalaCompileMojo.java:48)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo
(DefaultPluginManager.java:443)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:539)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec
ycle(DefaultLifecycleExecutor.java:480)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(DefaultLifecycleExecutor.java:459)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
Failures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:
334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced
(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode
(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] scala compiler returned non-zero value.
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: scala
compiler returned non-zero value.
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:564)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec
ycle(DefaultLifecycleExecutor.java:480)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(DefaultLifecycleExecutor.java:459)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
Failures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:
334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced
(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode
(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: scala
compiler returned non-zero value.
at iodp.usio.CommandMojo.runCommand(CommandMojo.java:70)
at iodp.usio.ScalaCompileMojo.execute(ScalaCompileMojo.java:48)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo
(DefaultPluginManager.java:443)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:539)
... 16 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Thu May 24 12:06:34 EST 2007
[INFO] Final Memory: 6M/12M
[INFO]
------------------------------------------------------------------------

Ryan Daum

unread,
May 23, 2007, 10:41:05 PM5/23/07
to lif...@googlegroups.com
My first thought is: is JAVA_HOME or JDK_HOME set? Is your JDK
installed?

Let me fire up IntelliJ and look at the maven-scala-plugin source and
see if I can see anything obvious...

Ryan

Ryan Daum

unread,
May 23, 2007, 10:45:19 PM5/23/07
to lif...@googlegroups.com
Please make sure you have the JAVA_HOME environment variable set, or if
that's not possible, call maven with -Djava.home=<java home>.

javaBin = System.getProperty("java.home");
if (javaBin == null) {
javaBin = System.getenv("JAVA_HOME");
if (javaBin == null) {
throw new MojoExecutionException("Couldn't locate java,
try setting JAVA_HOME environment variable.");
}
}
javaBin += File.separator + "bin" + File.separator + "java";

Ryan

Chris Wilkes

unread,
May 24, 2007, 12:11:55 AM5/24/07
to liftweb
What version of maven? "mvn -version"

Matthew Shilts

unread,
May 24, 2007, 12:22:47 AM5/24/07
to lif...@googlegroups.com
I have 2.0.5 on a mac. Java 1.5.0.

Make sure JAVA_HOME is set or it won't work. type echo $JAVA_HOME
from your command prompt to make sure it's set before you type mvn
install. If it isn't set it in your login script or manually on the
command line. On windows its somewhere buried in your system info..
(been a while since i've been subjected to windows for development)

Also.. make sure you type "mvn clean install" from the liftweb
directory that contains the pom.xml (pom.xml is what maven looks at
to figure out what to do, you might get more hints by looking in
there as well)

Good luck.
Matthew

Marc Boschma

unread,
May 24, 2007, 1:11:02 AM5/24/07
to lif...@googlegroups.com
Thanks, there was a problem with JAVA_HOME - set to /usr now. (I'm on
Mac OS X 10.4, from what I can tell using Apple's install of Java,
since I never installed it otherwise)

for interest, mvn -version reports "Maven version: 2.0.6" (from
Darwin Ports).

Scala is also sourced from Darwin Ports.

I don't like ~/.m2/* but I can tolerate it. And now that JAVA_HOME is
in place it all works!!! ;)

What I am looking at Scala and Lift for is a control system for a
nation wide professional video distribution system (it would need to
be highly available). The real-time possibilities of Lift as an
interface is really appealing. Customers of the platform can share
resources for a given time frame, dynamically prioritise their video,
etc. There is a scripting element to the old system that needs to be
replicated as well.

I had been looking at Erlang for the system to control all the video
adaptors (SNMP interfaces) but Erlang's unusualness has made the
customer shy. Scala at least targets a JVM which makes the customer
less concerned although not everyone there would understand the
difference between Scala and Java and in effect it shouldn't matter...

I'm still playing with the possible architectures and which bus /
middle-ware to settle on between nodes - which Lift would front. One
attraction of Erlang is having that distribution built in.

It is currently a background task as the network design is the
current focus.

Thanks for the help! Now I can start to dig, break and maybe even
start to grok it.

Regards,

Marc

Chris Wilkes

unread,
May 24, 2007, 10:16:23 AM5/24/07
to liftweb
I'm using Mac OS X 10.4 and have JAVA_HOME set to /Library/Java/Home.
You might want to set MAVEN_OPTS to -Xmx512m and M2_HOME to wherever
maven is installed (I'm not sure about darwinports, I installed mine
to /usr/local/maven).

Julien Wetterwald

unread,
May 24, 2007, 5:11:21 PM5/24/07
to lif...@googlegroups.com
Hi Marc,

For the record, I am using ant to compile lift. You can check out the build script as well as the required libraries in my branch of the repository.

I am sure maven is a great tool but I have never used it before. The numerous files the build script downloaded scared me too :-)

Cheers,
Julien

Marc Boschma

unread,
May 24, 2007, 7:59:05 PM5/24/07
to lif...@googlegroups.com
I'm seriously thinking of moving to ant as I set the M2_HOME environment variable and now maven won't get past "Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher
"

Even if I uninstall maven and put it back... sigh...

So your branch only differs around the use of ant over maven??

Regards,

Marc

Ryan Daum

unread,
May 24, 2007, 9:12:24 PM5/24/07
to lif...@googlegroups.com
What did you set M2_HOME to?

Please people, if you have complaints about the maven scala support,
take them to code.google.com/p/maven-scala-plugin and we will try and
help you out.

Having two build systems for Lift is only going to complicate things
going forward.

Ryan

Julien Wetterwald

unread,
May 25, 2007, 6:16:50 AM5/25/07
to lif...@googlegroups.com
Hi Marc,

> So your branch only differs around the use of ant over maven??
Well, not exactly. It is now slightly outdated and I will soon begin to
work on it. Ultimately, it will be merged with the main branch again.

Cheers,
Julien

David Pollak

unread,
May 25, 2007, 11:34:13 AM5/25/07
to lif...@googlegroups.com
Folks,

Maven will be the build system for lift.  Julien is running Ant on his branch as he's merging Teatro code into lift and Teatro used Ant as its build system.

On my Mac (10.4.9), my .bash_login script is:
pony:~ dpp$ cat .bash_login
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"

export PATH=$PATH:/sw/bin:/usr/local/mysql/bin:/opt/local/bin

export JAVA_HOME=/Library/Java/Home
export EDITOR=emacs
And on my Linux (Ubuntu 7.04, yes, I'm a Fawn Fan):
export CLASSPATH=.
export JDK_BASE=/usr/lib/jvm/java
export JAVA_HOME=${JDK_BASE}
export HADOOP_HEAPSIZE=200

export PATH=$PATH:$JDK_BASE/bin

export PATH=$PATH:~/bin

export SCALA_HOME=/usr/local/share/scala
Maven "just works" for me.  I really like being able to pull down all the packages needed to build lift automatically.  Plus Brice and Ryan have been responsive to Scala/Maven related issues.

Thanks,

David
Message has been deleted

mahadevan

unread,
Jun 9, 2007, 6:13:33 AM6/9/07
to liftweb
Though my issue is not of above error, I am facing OutOfMemoryError
while compiling lif code(scala code) via maven scala compiler plugin.
Here is the output:

[mahadevan@h3 liftweb]$ mvn clean:clean install


[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] Lift
[INFO] Lift Core
[INFO] Lift Example
[INFO] Skittr Example

[INFO] Searching repository for plugin with prefix: 'clean'.
[INFO]
----------------------------------------------------------------------------
[INFO] Building Lift
[INFO] task-segment: [clean:clean, install]
[INFO]
----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
target
[INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
target/classes
[INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
target/test-classes
[INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
target/site


[INFO] [site:attach-descriptor]
[INFO] [install:install]

[INFO] Installing /2/home/mahadevan/src/java/liftweb/liftweb/pom.xml
to /2/home/mahadevan/.m2/repository/net/liftweb/lift/0.2.0/
lift-0.2.0.pom
[INFO]
----------------------------------------------------------------------------
[INFO] Building Lift Core
[INFO] task-segment: [clean:clean, install]
[INFO]
----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
lift/target
[INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
lift/target/classes
[INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
lift/target/test-classes
[INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
lift/target/site


[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [scala:compile {execution: default}]

[INFO] Exception in thread "main" java.lang.OutOfMemoryError: Java
heap space


[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] scala compiler returned non-zero value.
[INFO]
------------------------------------------------------------------------

[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3 minutes 39 seconds
[INFO] Finished at: Sat Jun 09 13:25:24 IST 2007
[INFO] Final Memory: 13M/31M
[INFO]
------------------------------------------------------------------------
[mahadevan@h3 liftweb]$

export MAVEN_OPTS=-Xmx512M
Is not helpful as it is applying these JVM options to command 'mvn'
--
but not to maven-scala-compiler-JVM-task(which is forked as separate
JVM)

I don't know what options are needed in pom files to make the -Xmx
flags to
JVM for scala plugin. So I did following workaround(ugly one for the
timebeing to make maven plugin to compil code):


# export JAVA_HOME=MY_JDK_HOME
# mv $JAVA_HOME/jre/bin/java $JAVA_HOME/jre/bin/java_exe

Created a java-shell-script with following contents

#!/bin/sh
exec /opt/jdk1.5.0_11/jre/bin/java_exe "-Xmx256m" $*

Now ran the 'mvn' command to compile liftweb:

$ mvn clean:clean install

compilation was successfull finally with the above temproray-ugly-
fix :)

May be some maven-expert could let us know how to set the JVM max-
heap-
space for maven-scal-compiler task.

Ryan Daum

unread,
Jun 9, 2007, 7:19:55 AM6/9/07
to lif...@googlegroups.com
Hi there,

Checking out the subversion repository version of the maven-scala-plugin
(code.google.com/p/maven-scala-plugin) and building it (mvn install)
will give you a version where the system properties are copied from the
parent Java VM process to the child. I'm not sure if heap settings can
be solved this way or not.

Give this a try and let me know if it solves your problem.

If not, we will have to look into an additional set of options to pass
to the child process.

Ryan

On Sat, 2007-09-06 at 10:10 +0000, mahadevan wrote:
> Thoough my issue is not of above error, I am facing OutOfMemoryError


> while compiling lif code(scala code) via maven scala compiler plugin.

> Here iprocess s the output:


>
> [mahadevan@h3 liftweb]$ mvn clean:clean install

> [INFO] Scanning for projects...
> [INFO] Reactor build order:
> [INFO] Lift
> [INFO] Lift Core
> [INFO] Lift Example
> [INFO] Skittr Example

> [INFO] Searching repository for plugin with prefix: 'clean'.
> [INFO]
> ----------------------------------------------------------------------------

> [INFO] Building Lift


> [INFO] task-segment: [clean:clean, install]
> [INFO]
> ----------------------------------------------------------------------------
> [INFO] [clean:clean]
> [INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
> target
> [INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
> target/classes
> [INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
> target/test-classes
> [INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
> target/site

> [INFO] [site:attach-descriptor]
> [INFO] [install:install]

> [INFO] Installing /2/home/mahadevan/src/java/liftweb/liftweb/pom.xml
> to /2/home/mahadevan/.m2/repository/net/liftweb/lift/0.2.0/
> lift-0.2.0.pom
> [INFO]
> ----------------------------------------------------------------------------

> [INFO] Building Lift Core


> [INFO] task-segment: [clean:clean, install]
> [INFO]
> ----------------------------------------------------------------------------
> [INFO] [clean:clean]
> [INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
> lift/target
> [INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
> lift/target/classes
> [INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
> lift/target/test-classes
> [INFO] Deleting directory /2/home/mahadevan/src/java/liftweb/liftweb/
> lift/target/site

> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:compile]
> [INFO] Nothing to compile - all classes are up to date
> [INFO] [scala:compile {execution: default}]

> [INFO] Exception in thread "main" java.lang.OutOfMemoryError: Java
> heap space

> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] scala compiler returned non-zero value.
> [INFO]
> ------------------------------------------------------------------------

> [INFO] For more information, run Maven with the -e switch

> [INFO]
> ------------------------------------------------------------------------


> [INFO] Total time: 3 minutes 39 seconds
> [INFO] Finished at: Sat Jun 09 13:25:24 IST 2007
> [INFO] Final Memory: 13M/31M
> [INFO]
> ------------------------------------------------------------------------
> [mahadevan@h3 liftweb]$
>
> export MAVEN_OPTS=-Xmx512M
> Is not helpful as it is applying these JVM options to command 'mvn' --
> but not to maven-scala-compiler-JVM-task(which is forked as separate
> JVM)
>

> I don't what options are needed in pom files to make the -Xmx flags to

David Pollak

unread,
Jun 9, 2007, 9:55:02 AM6/9/07
to lif...@googlegroups.com
From what I understand, the JVM memory size is computed by taking 1/4 of your actual RAM.  I compile and test on a 2GB or 4GB machine, so my JVM memory size is quite large.

Ryan -- when will plugin 1.1 be on the Maven archives so we can change the lift pom.xml to use 1,1?
--
lift, the fast, powerful, easy web framework
http://liftweb.net

Ryan Daum

unread,
Jun 10, 2007, 11:59:06 AM6/10/07
to lif...@googlegroups.com
On Sat, 2007-09-06 at 06:55 -0700, David Pollak wrote:

> Ryan -- when will plugin 1.1 be on the Maven archives so we can change
> the lift pom.xml to use 1,1?

I think Brice is hosting the plugin right now. I guess we should look
into doing another release and getting it into the main Maven
repositories.

Ryan

David Pollak

unread,
Jun 10, 2007, 4:57:36 PM6/10/07
to lif...@googlegroups.com
Ryan,

I'm happy to host on maven.liftweb.net  Just let me know.

Thanks,

David

mahadevan

unread,
Jun 11, 2007, 12:13:31 PM6/11/07
to liftweb

I checked-out maven-scala plugin and added following code to handle
extra JVM options like -X, -X options in following order:
* For JVM System.getProperties method (JVM options as supplied by -
DK1=V1
* For JVM System.getEnv from OS-env-vars

Fix got compiled and plugin.jar has been made.

Tried to test liftweb scala compile, but don't know what changes to do
pom.xml of liftweb to make use of compile plugin.jar

FIX is:

--- src/main/java/scala/maven/ScalaMojo.java (revision 10)
+++ src/main/java/scala/maven/ScalaMojo.java (working copy)
@@ -43,7 +43,21 @@


throw new MojoExecutionException("Couldn't locate
java, try setting JAVA_HOME environment variable.");
}
}

+ // Provide support for JVM specific options like -X, -XX
flags
+ String jvmFlags = System.getProperty("JAVA_OPTIONS");
+ if(jvmFlags == null) {
+ jvmFlags = System.getenv("JAVA_OPTIONS");
+ if (jvmFlags == null) {
+ jvmFlags = "";
+ }else{
+ jvmFlags.trim();
+ jvmFlags = " " + jvmFlags + " ";
+ }
+ }


javaBin += File.separator + "bin" + File.separator + "java";

+ if(!"".equals(jvmFlags)){
+ javaBin += jvmFlags;
+ }

}

Made the plugin jar with following name : maven-scala-plugin-1.1-
SNAPSHOT.jar


[mahadevan@h3 maven-scala-plugin]$ svn info
Path: .
URL: http://maven-scala-plugin.googlecode.com/svn/trunk
Repository Root: http://maven-scala-plugin.googlecode.com/svn
Repository UUID: b3ddc661-202f-0410-864d-fbe52e633960
Revision: 10
Node Kind: directory
Schedule: normal
Last Changed Author: ryan.daum
Last Changed Rev: 10
Last Changed Date: 2007-06-07 23:40:42 +0530 (Thu, 07 Jun 2007)

> Ryan,
>
> I'm happy to host on maven.liftweb.net Just let me know.
>
> Thanks,
>
> David
>

> On 6/10/07, Ryan Daum <r...@darksleep.com> wrote:
>
>
>
>
>
> > On Sat, 2007-09-06 at 06:55 -0700, David Pollak wrote:
>
> > > Ryan -- when will plugin 1.1 be on the Maven archives so we can change
> > > the lift pom.xml to use 1,1?
>
> > I think Brice is hosting the plugin right now. I guess we should look
> > into doing another release and getting it into the main Maven
> > repositories.
>
> > Ryan
>

Michael Campbell

unread,
Jun 11, 2007, 12:44:52 PM6/11/07
to lif...@googlegroups.com
Minor bug in your patch here...

> --- src/main/java/scala/maven/ScalaMojo.java (revision 10)
> +++ src/main/java/scala/maven/ScalaMojo.java (working copy)
> @@ -43,7 +43,21 @@
> throw new MojoExecutionException("Couldn't locate
> java, try setting JAVA_HOME environment variable.");
> }
> }
> + // Provide support for JVM specific options like -X, -XX
> flags
> + String jvmFlags = System.getProperty("JAVA_OPTIONS");
> + if(jvmFlags == null) {
> + jvmFlags = System.getenv("JAVA_OPTIONS");
> + if (jvmFlags == null) {
> + jvmFlags = "";
> + }else{
> + jvmFlags.trim();

This line does not modify jvmFlags as I think to expect it to, but
rather returns a copy, trimmed, due to Java String immutability.

Also, you seem to only be trimming and re-padding with spaces if it's
an environment variable, and not a property. Is this intentional?

mahadevan

unread,
Jun 11, 2007, 1:09:47 PM6/11/07
to liftweb
Both are mistakes .
Thanks for pointing it out.

[mahadevan@h3 maven-scala-plugin]$ svn diff
Index: src/main/java/scala/maven/ScalaMojo.java
===================================================================


--- src/main/java/scala/maven/ScalaMojo.java (revision 10)
+++ src/main/java/scala/maven/ScalaMojo.java (working copy)

@@ -43,8 +43,22 @@


throw new MojoExecutionException("Couldn't locate
java, try setting JAVA_HOME environment variable.");
}
}
+ // Provide support for JVM specific options like -X, -XX
flags
+ String jvmFlags = System.getProperty("JAVA_OPTIONS");
+ if(jvmFlags == null) {
+ jvmFlags = System.getenv("JAVA_OPTIONS");
+ if (jvmFlags == null) {
+ jvmFlags = "";
+ }

+ }
+ jvmFlags = jvmFlags.trim();


javaBin += File.separator + "bin" + File.separator + "java";

+ if(!"".equals(jvmFlags)){


+ jvmFlags = " " + jvmFlags + " ";

+ javaBin += jvmFlags;
+ }
+
}

public static String join(Collection<String> s, String delimiter)
{


On Jun 11, 9:44 pm, "Michael Campbell" <michael.campb...@gmail.com>
wrote:

Ryan Daum

unread,
Jun 11, 2007, 1:13:22 PM6/11/07
to lif...@googlegroups.com
Hey there, can you add this as a defect/feature issue on the project at
code.google.com/p/maven-scala-plugin ?

Alternatively, if you see yourself making further contributions to the
plugin, you could be added to the committers list for the subversion
repository.

Ryan

Reply all
Reply to author
Forward
0 new messages