0

ZKLessEngine cannot find lessc

asked 2020-10-11 19:53:59 +0800

mmaxim gravatar image mmaxim
31

Hi!

I'm trying to compile my LESS files under local maven project on my computer (macOS, Eclipse IDE). Every time I get error:

java.io.IOException: Cannot run program "lessc" (in directory "/"): error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at org.zkoss.maven.ZKLessEngine.compileLess(ZKLessEngine.java:137)

delete flag offensive retag edit

3 Answers

Sort by ยป oldest newest most voted
0

answered 2020-10-12 18:12:04 +0800

MDuchemin gravatar image MDuchemin
1758 1 5
ZK Team

Hi mmaxim,

Which command are you running to trigger this issue? It looks like the compiler is trying to run on "/" (host root directory) which you shoud probably not have rights to access or less files available there anyway

Might be a weird interaction between macOS and the path variable, or a configuration issue. Could you post the zk-less-engine plugin part of your pom file to check if there's anything unexpected there?

link publish delete flag offensive edit
0

answered 2020-10-12 18:50:14 +0800

MDuchemin gravatar image MDuchemin
1758 1 5
ZK Team

Could be related to this: https://stackoverflow.com/questions/54742540/java-caused-by-java-io-ioexception-error-2-no-such-file-or-directory

someone using command line tools on macOS having issues with commands not being available on the path.

could be that the same thing is happening to you in that case, with the terminal not finding the lessc command.

Also, depending on the version of the zkless engine, you may need to pass a parameter telling it where to find the less files to compile, and where to output them.

link publish delete flag offensive edit

Comments

If I, for example, execute lessc command using command line it works just fine. It also works when i run maven install on the PC at work.

mmaxim ( 2020-10-15 06:18:06 +0800 )edit

<plugin> <groupId>org.zkoss.maven</groupId> <artifactId>zkless-engine-maven-plugin</artifactId> <version>1.0.0</version> <executions> <execution> <id>compile-less</id> <goals> <goal>lessc</goal> </goals>

mmaxim ( 2020-10-15 06:29:54 +0800 )edit

<configuration> <!-- LESS source folder --> <sourceDirectory> <!-- we use default --> <!-- ${project.basedir}/src/main/resources/ --> </sourceDirectory> <!-- *.CSS.DSP output folder --> <outputDirectory> <!-- we use default --> <!--

mmaxim ( 2020-10-15 06:30:23 +0800 )edit

<!-- ${project.basedir}/src/main/resources/ --> </outputDirectory> </configuration> </execution> </executions> </plugin>

mmaxim ( 2020-10-15 06:34:03 +0800 )edit
0

answered 2020-10-15 17:04:28 +0800

mmaxim gravatar image mmaxim
31

updated 2020-10-15 21:42:42 +0800

cor3000 gravatar image cor3000
5399 2 7
ZK Team

Here is the zk-less-engine plugin part of the pom:

<plugin>
    <groupId>org.zkoss.maven</groupId>
    <artifactId>zkless-engine-maven-plugin</artifactId>
    <version>1.0.0</version>
    <executions>
        <execution>
            <id>compile-less</id>
            <goals>
                <goal>lessc</goal>
            </goals>
            <configuration>
                    <!-- LESS source folder -->
                    <sourceDirectory>
                         <!-- we use default -->
                         <!-- ${project.basedir}/src/main/resources/ -->
                </sourceDirectory>
                <!-- *.CSS.DSP output folder -->
                <outputDirectory>
                      <!-- we use default -->
                      <!-- ${project.basedir}/src/main/resources/ -->
                </outputDirectory>
            </configuration>
        </execution>
    </executions>
</plugin>
link publish delete flag offensive edit

Comments

you mentioned earlier that this already works from command line... so the problem is not within your maven configuration. Please check your IDE path: whether lessc is accessible from the path of your eclipse process. Your console can have different PATH variables than your ui processes.

cor3000 ( 2020-10-15 21:55:53 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2020-10-11 19:53:59 +0800

Seen: 15 times

Last updated: Oct 15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More