Closed dbclkclk closed 9 years ago
Hm, can you show me your configuration from pom.xml? Looks like it might be some bower arguments problem.
Thanks @adamdubiel
<build>
<finalName>xxxxx-website</finalName>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<warSourceExcludes>/resources/js/**</warSourceExcludes>
</configuration>
</plugin>
<plugin>
<groupId>pl.allegro</groupId>
<artifactId>grunt-maven-plugin</artifactId>
<version>1.4.1</version>
<configuration>
<!-- relative to src/main/webapp/, default: static -->
<jsSourceDirectory>/resources/js/</jsSourceDirectory>
<!-- example options usage to get verbose output in logs -->
<gruntOptions>
<gruntOption>--verbose</gruntOption>
</gruntOptions>
<!-- example npm install env variable -->
<npmEnvironmentVar>
<PHANTOMJS_CDNURL>http://cnpmjs.org/downloads</PHANTOMJS_CDNURL>
</npmEnvironmentVar>
<!-- example options usage to filter variables in given resource -->
<filteredResources>
<filteredResource>maven-properties.json</filteredResource>
</filteredResources>
</configuration>
<executions>
<execution>
<goals>
<goal>create-resources</goal>
<goal>npm</goal>
<!-- or npm-offline if npm failure is not an option -->
<goal>bower</goal>
<goal>grunt</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.12</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>unit-tests</id>
<phase>unit-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
<includes>
<include>**/*UnitTest.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18</version>
<configuration>
<includes>
<include>**/*IntegrationTest.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</build>
Hm, okay, so it's just standard config - something with environment then. Could you disable bower target and see if grunt builds? Do you have bower as system-wide executable on Jenkins?
Do you mean removing "bower" from the goal? I did and the build fails for another goal "grunt". See error
Cannot run program "grunt" (in directory "/home/rof/src/bitbucket.org/jorge-sandoval/xxxxx_web/target-grunt"): error=2, No such file or directory -> [Help 1
I am beginning to think this has something to do with exec. it keeps complaining that the directory does not exist. The build is being run on Jenkins not locally. Locall with maven test
, everything passes.
I think it's something with environment. Do you have grunt-cli
installed on Jenkins? I don't see any other explaination for this exit code. Alternatively, try running grunt like this.
@adamdubiel That could be the issue. I don't have the grunt-cli in the dependency. I will try it out. Thanks.
In case if somone as me faced similar issue, please not that
sudo npm install -g grunt
is not the same as npm install -g grunt
if yuo are using such tools as nave, nvm or n for node version management.
Hey, Even I am facing the same issue on Jenkins build when I try maven deploy command. In local eclipse everything works fine. I have only these below entries in pom.xml.
Can anyone help me resolve this?
<plugin>
<groupId>pl.allegro</groupId>
<artifactId>grunt-maven-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<goals>
<goal>npm</goal>
<goal>grunt</goal>
</goals>
</execution>
</executions>
</plugin>
And this is my GruntFile
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
core: {
files: [{
expand: true,
cwd: 'src/main/webapp',
src: 'js/*.js',
dest: "src/main/webapp/build",
ext: '.min.js'
}]
}
},
});
grunt.registerTask('default', ['uglify']);
};
Hey Folks:
I am getting the following issue from Jenkins. Any ideas?