Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build Dashboard error #4143

Closed
xiong305817127 opened this issue Feb 15, 2017 · 7 comments
Closed

build Dashboard error #4143

xiong305817127 opened this issue Feb 15, 2017 · 7 comments
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.

Comments

@xiong305817127
Copy link

hi,I encountered a problem when using Maven to build Dashboard in che 5.2.2

Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (compile) on project che-dashboard-war: An Ant BuildException has occured: Replace: source file /home/user/source/dashboard/dist/index.html doesn't exist
[ERROR] around Ant part ...... @ 7:63 in /home/user/source/dashboard/target/antrun/build-main.xml
[ERROR] -> [Help 1]

I compare che5.2.2 and che5.0.1 versions of the dashboard pom.xml ,Find some change :
v5.0.1:

                            <target>
                                <!-- Download NPM dependencies -->
                                <exec dir="${basedir}" executable="npm" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Download Typings dependencies -->
                                <exec dir="${basedir}" executable="typings" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Download Bower dependencies -->
                                <exec dir="${basedir}" executable="bower" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Build the application -->
                                <exec dir="${basedir}" executable="gulp" failonerror="true">
                                    <arg value="build" />
                                </exec>
                                <!-- Change base HREF of the application that will be hosted on /dashboard -->
                                <replace file="${basedir}/dist/index.html">
                                    <replacetoken><![CDATA[<base href="/">]]></replacetoken>
                                    <replacevalue><![CDATA[<base href="/dashboard/">]]></replacevalue>
                                </replace>
                            </target>
                        </configuration>

v5.2.2:

 <configuration>
                            <target>
                                <!-- Download NPM dependencies -->
                                <exec dir="${basedir}" executable="npm" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Change base HREF of the application that will be hosted on /dashboard -->
                                <replace file="${basedir}/dist/index.html">
                                    <replacetoken><![CDATA[<base href="/">]]></replacetoken>
                                    <replacevalue><![CDATA[<base href="/dashboard/">]]></replacevalue>
                                </replace>
                            </target>
                        </configuration>

I'm using a new machine (never built dashboard) ,I add code that has been deleted in che5.2.2 at dashboard pom.xml

   <!-- Download Typings dependencies -->
                                <exec dir="${basedir}" executable="typings" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Download Bower dependencies -->
                                <exec dir="${basedir}" executable="bower" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Build the application -->
                                <exec dir="${basedir}" executable="gulp" failonerror="true">
                                    <arg value="build" />
                                </exec>

use mvn clean install ,I get a success, but there are some errors in the log,Can I ignore it?

[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ che-dashboard-war ---
[INFO] Installing /home/user/source/dashboard/target/dashboard-war.war to /root/.m2/repository/org/eclipse/che/dashboard/che-dashboard-war/5.2.2/che-dashboard-war-5.2.2.war
[INFO] Installing /home/user/source/dashboard/pom.xml to /root/.m2/repository/org/eclipse/che/dashboard/che-dashboard-war/5.2.2/che-dashboard-war-5.2.2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ----------------

There are many similar error:

...
     [exec] ERROR in [default] /home/user/source/dashboard/src/components/widget/text-info/che-text-info.directive.ts:24:9 
     [exec] Property 'restrict' does not exist on type 'CheTextInfo'.
     [exec] 
     [exec] ERROR in [default] /home/user/source/dashboard/src/components/widget/text-info/che-text-info.directive.ts:25:9 
     [exec] Property 'replace' does not exist on type 'CheTextInfo'.
     [exec] 
     [exec] ERROR in [default] /home/user/source/dashboard/src/components/widget/text-info/che-text-info.directive.ts:26:9 
     [exec] Property 'transclude' does not exist on type 'CheTextInfo'.
     [exec] 
     [exec] ERROR in [default] /home/user/source/dashboard/src/components/widget/text-info/che-text-info.directive.ts:27:9 
     [exec] Property 'templateUrl' does not exist on type 'CheTextInfo'.
     [exec] 
     [exec] ERROR in [default] /home/user/source/dashboard/src/components/widget/text-info/che-text-info.directive.ts:30:9 
     [exec] Property 'scope' does not exist on type 'CheTextInfo'.
     [exec] [15:56:51] Finished 'scripts' after 50 s

I have a suggestion :

In dashboard pom.xml ,There is such a setup :

 <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${basedir}/bower_components</directory>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                        <fileset>
                            <directory>${basedir}/node_modules</directory>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                        <fileset>
                            <directory>${basedir}/dist</directory>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>

Can I get rid of this?Otherwise build very slow .

 <fileset>
                            <directory>${basedir}/bower_components</directory>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                        <fileset>
                            <directory>${basedir}/node_modules</directory>
                            <followSymlinks>false</followSymlinks>
                        </fileset>

thanks!

@benoitf
Copy link
Contributor

benoitf commented Feb 15, 2017

hello @xiong305817127 , the npm installcommand is now in charge of calling all the steps
https://github.com/eclipse/che/blob/master/dashboard/package.json#L72

what is the error when you run command npm install without any patch ?

about the error

 [exec] Property 'restrict' does not exist on type 'CheTextInfo'.
     [exec] 

you can skip them, it's warnings about TypeScript. We're migrating all js code to TypeScript so when type is not set we have these warnings

about the slow build process, yes you can remove the cleanup of npm and bower modules.
It's there to ensure we're always using something new when using mvn clean install

BTW using only mvn install(without clean should have the same effect)

@benoitf benoitf added the kind/question Questions that haven't been identified as being feature requests or bugs. label Feb 15, 2017
@xiong305817127
Copy link
Author

@benoitf , I run the command npm install below dashboard,The following warning appears :

[root@SZX1000132656 dashboard]# npm install
npm WARN cannot run in wd che-dashboard@4.0.0 npm run bower && npm run typings && npm run build (wd=/home/user/source/Che5.0/EclipseChe/dashboard)

I found a similar problem :
npm-install-failed-with-cannot-run-in-wd

Add the unsafe-perm flag to my package.json:
"config": {
"unsafe-perm":true
}

I get a success, thanks.

@ghost ghost closed this as completed Feb 20, 2017
@ghost
Copy link

ghost commented Mar 9, 2017

I have very similar problem.
My dashboard module won't build, and when I try to start up Che, I get exceptions in chrome ngTouch module won't load because it doesn't exist. Not sure if those 2 are related but they might be.

In build_log.txt is the building log from mvn clean install command in che/dashboard folder.

build_log.txt

I tried putting unsafe-perm flag but no luck.

@TylerJewell
Copy link

@ndjuric93 - please open a new issue and provide all steps that you have taken to make the issue reproducible. Then an engineer can help.

@ashumilova
Copy link
Contributor

@ndjuric93 It was fixed yesterday by this PR #4365. Please, update to current version.

@ghost
Copy link

ghost commented Mar 10, 2017

@ashumilova @TylerJewell Thanks a lot, updating bower.json solved it.

@sonicning
Copy link

sonicning commented Mar 29, 2017

Hi there,
I had the similar error

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:08 min
[INFO] Finished at: 2017-03-28T16:16:22+08:00
[INFO] Final Memory: 29M/981M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (compile) on project che-dashboard-war: An Ant BuildException has occured: exec returned: 1
[ERROR] around Ant part ...<exec failonerror="true" dir="/root/codereview/che/dashboard" executable="npm">... @ 4:82 in /root/codereview/che/dashboard/target/antrun/build-main.xml
[ERROR] -> [Help 1]
[ERROR]

then it turned out warning like yours

[root@SZX1000132656 dashboard]# npm install
npm WARN cannot run in wd che-dashboard@4.0.0 npm run bower && npm run typings && npm run build (wd=/home/user/source/Che5.0/EclipseChe/dashboard)

I tried to add these to pom.xml , but it didn't work

<!-- Download Typings dependencies -->
                                <exec dir="${basedir}" executable="typings" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Download Bower dependencies -->
                                <exec dir="${basedir}" executable="bower" failonerror="true">
                                    <arg value="install" />
                                </exec>
                                <!-- Build the application -->
                                <exec dir="${basedir}" executable="gulp" failonerror="true">
                                    <arg value="build" />
                                </exec>

I also tired to add the unsafe-perm flag to my package.json , but it didn't work

"config": {
"unsafe-perm":true
}

finally , I searched and found out the key point was that npm was behind a proxy.
here are what I did to fix it:

1. npm config set strict-ssl false --global
2. npm config set registry http://registry.npms.org/ --global
3. npm config set http_proxy http://XXXXXXXXX:port/ --global
4. npm config set https-proxy http://XXXXXXXX:port/ --global
5. npm config set unsafe-perm true --global

to fix those errors by 
npm run bower && npm run typings && npm run build 

4. vim /root/.bowerrc
{
"allow_root": true,
"strict-ssl": false
 }

5. vim /root/.typingsrc
{
     "rejectUnauthorized": false,
     "registryURL": "http://api.typings.org/"
}

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.
Projects
None yet
Development

No branches or pull requests

5 participants