Difficulties with installation script for hybris 5.6.02 - sap-commerce-cloud

The installation script reports a Build failure...
mlittle-mbook1:~ mlittle$ pwd
/Users/mlittle
mlittle-mbook1:~ mlittle$ cd hybris/bin/platform
mlittle-mbook1:platform mlittle$ ls -a
. .project build.number global.properties project.properties setantenv.sh tomcat
.. .settings build.xml hybrisserver.bat resources tcServer
.classpath adminserver.bat env.properties hybrisserver.sh roles.bat tenant_foo.properties
.externalToolBuilders adminserver.sh ext lib roles.sh tenant_junit.properties
.fbprefs apache-ant-1.9.1 extensions.xml license.bat ruleset.xml tenant_t1.properties
.pmd bootstrap extgen license.sh setantenv.bat tenant_t2.properties
mlittle-mbook1:platform mlittle$ . ./setantenv.sh
mlittle-mbook1:platform mlittle$ ant clean all
Buildfile: /Users/mlittle/hybris/bin/platform/build.xml
[echo] /Users/mlittle/hybris/bin/platform/tomcat/bin
[echo] /Users/mlittle/hybris/bin/platform/ext/core/web/webroot/WEB-INF/external-dependencies.xml was not found!
BUILD FAILED
It is looking for the path, and the file at that path..
Users/mlittle/hybris/bin/platform/ext/core/web/webroot/WEB-INF/external-dependencies.xml
When one looks in the path, I could not find Users/mlittle/hybris/bin/platform/ext/core/web/??
Any suggestions?
Best Regards.
====
Additional information... [2015-10-09-0952 EST]
Step:
Procedure:
MJL comment…
1:Go to the Download page and download the packages you want to install.
:Done
2.:Create the directory where you will extract the ZIP archives. This directory must meet the following conditions:
It must be close to the system root directory (for example C:\hybris. You may download the files directly to the root directory, because the ZIP files already contain directory hybris). Microsoft Windows requires the directory paths to be shorter than 255 characters. Any part of a directory path exceeding this limitation is truncated. The hybris Commerce Suite modules installation creates several sub-directories, therefore use short directory paths.
Do not use directory paths containing spaces (such as C:\hybris Platform). Building the hybris Commerce Suite fails if the directory path contains spaces
:I have created a directory:
/00hybris/
3.:Extract the ZIP archives into the created directory. After the installation has been completed, the chosen directory should contain the structure similar to the example below:And unzipped the downloand file…
hybris-commerce-suite-5.6.0.2.zip into that path to get...
README
build-tools
hybris
hybris-Mobile-Apps-SDK
hybris-ems
hybris-oms
hybris-sbg
installer
licenses
And in the 00hybris/hybris path
bin
But Sebastian, I cannot find the 00hybris/hybris/config path after unzipping the download file…
4.:Set Up Apache Ant:
To set up Apache Ant, perform the following steps:
1. Open a command prompt in Microsoft Windows (shell in Unix family systems).
2. Navigate to the ${HYBRIS_BIN_DIR}/platform directory, for example:C:\hybris\bin\platform.
3. On Microsoft Windows systems, run the setantenv.bat file by entering setantenv.bat. Do not close the command window.
4. On Unix-based systems (like Mac OS X or Linux), run setantenv.sh by entering . ./setantenv.sh. Do not close the command window.
5. C:\hybris\bin\platform>setantenv.bat
6. Setting ant home to: C:\hybris-5.0\hybris\bin\platform\apache-ant-1.8.2
7. Apache Ant(TM) version 1.8.2 compiled on March 26 2013
:With this..
a. created a new shell session
b. Navigated to 00hybris/hybris/bin/platform…
mlittle-mbook1:hybris mlittle$ cd bin/platform
mlittle-mbook1:platform mlittle$ pwd.
-bash: pwd.: command not found
mlittle-mbook1:platform mlittle$ pwd
/Users/mlittle/00hybris/hybris/bin/platform
c. From /Users/mlittle/00hybris/hybris/bin/platform
, I ran, mlittle-mbook1:platform mlittle$ . ./setantenv.sh
with the result…
mlittle-mbook1:platform mlittle$ . ./setantenv.sh
mlittle-mbook1:platform mlittle$
It appeared to run, but it gave back no response: why?
5:Perform Build Procedure for hybris Commerce Suite
Go to the Windows command prompt (shell in Unix family systems), navigate to the ${HYBRIS_BIN_DIR}/platform directory and type ant clean all.:See response below…
mlittle-mbook1:platform mlittle$ ant clean all
Buildfile: /Users/mlittle/00hybris/hybris/bin/platform/build.xml
[echo] /Users/mlittle/00hybris/hybris/bin/platform/tomcat/bin
[echo] /Users/mlittle/00hybris/hybris/bin/platform/ext/core/web/webroot/WEB-INF/external-dependencies.xml was not found!
[mkdir] Created dir: /Users/mlittle/00hybris/hybris/log
[mkdir] Created dir: /Users/mlittle/00hybris/hybris/data
[mkdir] Created dir: /Users/mlittle/00hybris/hybris/temp/hybris
[mkdir] Created dir: /Users/mlittle/00hybris/hybris/roles
[input]
[input] **** NO CONFIG FOLDER FOUND ****
[input]
[input] No config folder was found at /Users/mlittle/00hybris/hybris/config.
[input] A "fresh" folder containing basic configuration files and the hybris
[input] demo licence will be created for your convenience.
[input] Please adjust and review the configuration files (and license) and
[input] call 'ant' again. This directory will never be overridden or
[input] touched again. Always use this configuration folder for configuration
[input] of platform, do not change anything within the platform folder.
[input]
[input] Please choose the configuration template.
[input] Press [Enter] to use the default value ([develop], production)
[copy] Copying 27 files to /Users/mlittle/00hybris/hybris/config
[copy] Copying 1 file to /Users/mlittle/00hybris/hybris/config
BUILD FAILED
/Users/mlittle/00hybris/hybris/bin/platform/build.xml:20: The following error occurred while executing this line:
/Users/mlittle/00hybris/hybris/bin/platform/resources/ant/antmacros.xml:123: java.lang.UnsupportedClassVersionError: de/hybris/ant/taskdefs/DbDriverValidator : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at org.apache.tools.ant.AntClassLoader.defineClassFromData(AntClassLoader.java:1128)
at org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader.java:1299)
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1354)
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1315)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1068)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:579)
at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:237)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:217)
at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:154)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:168)
at org.apache.tools.ant.taskdefs.ImportTask.importResource(ImportTask.java:230)
at org.apache.tools.ant.taskdefs.ImportTask.execute(ImportTask.java:162)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:179)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:93)
at org.apache.tools.ant.Main.runBuild(Main.java:826)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Total time: 21 seconds
mlittle-mbook1:platform mlittle$
5: Continued
Checking what this has done…
a. it has created a directory structure under 00hybris/hybris:
bin
config
data
log
path.txt
path2.txt
roles
temp
And opening the 00Hybris/hybris/config/localextensions.xml file..
<path dir="${HYBRIS_BIN_DIR}" />
<!-- ext-platform-optional -->
<!-- ext-incubator -->
<!-- ext-commerce -->
<!-- ext-backoffice -->
<!-- ext-accelerator -->
<!-- ext-cockpit -->
<!-- ext-channel -->
<!-- ext-addon -->
<!-- ext-supportability -->
<!-- ext-content -->
<!-- ext-integration -->
<!-- ext-print -->
<!-- ext-template -->
<extension name="yempty" />
<!-- ext-atddtests -->
<!-- ext-data -->
<!-- ext-eventtracking -->
<!-- ext-integration/sap/adtreco -->
<!-- ext-integration/sap/asynchronousOM -->
<!-- ext-integration/sap/availability -->
<!-- ext-integration/sap/pointofsale -->
<!-- ext-integration/sap/creditCheck -->
<!-- ext-integration/sap/masterdata -->
<!-- ext-integration/sap/core -->
<!-- ext-integration/sap/testsupport -->
<!-- ext-integration/sap/synchronousPricing -->
<!-- ext-integration/sap/sapprodreco -->
<!-- ext-integration/sap/productconfig -->
<!-- ext-integration/sap/synchronousOM -->
</extensions>
It does not seem to have populated the variable with the value for ${HYBRIS_BIN_DIR}... 00hybris/hybris/bin??
====
2015-10-10-1726EST
OK... investigated...
The problem is because there is an incompatibility between the version hybris was compiled and what is on my machine...

I think the root cause of the problem might be the wrong java version:
java.lang.UnsupportedClassVersionError: de/hybris/ant/taskdefs/DbDriverValidator : Unsupported major.minor version 52.0
indicates a java version conflict.
Hybris 5.6 should work with java, you can check at https://wiki.hybris.com/display/release5/System+Requirements+-+Release+5.6
Do you maybe have java 6 installed?
You can see via
java -version
To be sure you should use java 8 as per https://wiki.hybris.com/display/general/Third-Party+Compatibility+-+Release+5.6
(btw, you can also signup for the https://experts.hybris.com/ forum to get more in-depth hybris answers)

Hybris 5.6+ requires Java 8, update your environment variables to point Java 1.8
More references here:
http://hybrisdude.blogspot.com/2015/09/hybris-setup-issue-unsupported.html

Found a post regarding this and it also helped to solve the issue :
hybris installation issure resolved

Related

hudson*.groovy not found in jenkins

I am trying to configure jenkins job with groovy scripts, I donot know what I am doing wrong with the configuration that I could not execute even a simple groovy command like
println System.getenv("PATH")
it shows the following stack trace when the jenkins tries to build then following error is thrown
[workspace] $ groovy "C:\Program Files (x86)\Jenkins\jobs\{Project_Name}\workspace\hudson2392295018240496017.groovy"
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: Cannot run program "groovy" (in directory "C:\Program Files (x86)\Jenkins\jobs\{Project_Name}\workspace"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:780)
at hudson.Launcher$ProcStarter.start(Launcher.java:360)
at hudson.Launcher$ProcStarter.join(Launcher.java:367)
at hudson.plugins.groovy.Groovy.perform(Groovy.java:110)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:160)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:535)
at hudson.model.Run.execute(Run.java:1732)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:234)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 16 more
Build step 'Execute Groovy script' marked build as failure
Finished: FAILURE
I am using default groovy version in jenkins configuration and have installed the jenkins plugins for groovy.
I am new to both jenkins and groovy.
Thanks in advance.
You need to have an install of Groovy which your Jenkins can see - which is the default option
Alternatively, you can add one in the global config
which can then be used in the build step
Started by user anonymous
Building in workspace /Users/xxxxxx/.jenkins/jobs/gr/workspace
[workspace] $ groovy /Users/xxxxx/.jenkins/jobs/gr/workspace/hudson5419917819864291744.groovy
build
/Users/xxxxxx/perl5/perlbrew/bin:/Users/xxxxx/perl5/perlbrew/perls/perl-5.16.0/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
Finished: SUCCESS

Downloading dependencies using grape with Jenkins Job DSL plugin error

I did a job using Jenkins Job DSL plugin to get SVN branches with SVNKit libraries, but I have one problem setting de jar libraries using Grape (which uses Ivy).
If I set this in my script:
#Grapes(
#Grab(group='org.tmatesoft.svnkit', module='svnkit', version='1.8.3')
)
import org.tmatesoft.svn.core.SVNDirEntry
import org.tmatesoft.svn.core.SVNNodeKind
...
...
I get the following error:
FATAL: startup failed:
General error during conversion: Error grabbing Grapes -- [download failed: net.java.dev.jna#jna;3.5.2!jna.jar]
java.lang.RuntimeException: Error grabbing Grapes -- [download failed: net.java.dev.jna#jna;3.5.2!jna.jar]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
...
It's quite curious because if I go to %USERPROFILE%\.groovy\grapes\org.tmatesoft.svnkit\svnkit\jars the jars of SVNKIT are there but for some strange reason Grapes can't download JNA jars.
I workaround this problem downloading JNA jar in the grapes path, and it worked, but I would like what is happening and how to do this in the right way.
I'm using:
Windows 7 64 bits
Oracle JDK 1.6.0_45
Apache Tomcat 5.5.26
Jenkins 1.553
Job DSL Jenkins plugin 1.21
UPDATE:
I don't know why, but now after delete de .groovy folder, seems that is working ok.
I guess that I had a network problem while I try to get JNA for the first time and Ivy decided to set JNA as broken link on Maven Central. The reason why now works could be because after I delete the .groovy folder, Grape tried to download and this time network was ok.
It would be nice if someone can clarify this :)
We use our nexus as a host in the grapeConfig.xml.
<?xml version="1.0" encoding="UTF-8"?>
<ivy-settings>
<settings defaultResolver="downloadGrapes" />
<property name="repo.host" value="ourhost.on.network" override="false"/>
<property name="repo.realm" value="Sonatype Nexus Repository Manager" override="false"/>
<property name="repo.user" value="xxx" override="false"/>
<property name="repo.pass" value="xxx" override="false"/>
<credentials host="nexus.evdssz.admin.ch" realm="${repo.realm}" username="${repo.user}" passwd="${repo.pass}"/>
<resolvers>
<chain name="downloadGrapes" returnFirst="true">
<ibiblio name="nexus" root="https://ourhost.on.network:8443/nexus/content/groups/public/" m2compatible="true"/>
<ibiblio name="nexusreleases" root="https://ourhost.on.network:8443/nexus/content/repositories/releases/" m2compatible="true"/>
<ibiblio name="localm2" root="file:/opt/jenkins_home/.m2/repository/" checkmodified="true" changingPattern=".*" changingMatcher="regexp" m2compatible="true"/>
</chain>
</resolvers>
</ivy-settings>
The following example code is used in the groovy library in Jenkins:
import com.google.common.collect.HashBiMap
#Grab(group='com.google.code.google-collections', module='google-collect', version='snapshot-20080530')
def getFruit() { [grape:'purple', lemon:'yellow', orange:'orange'] as HashBiMap }
assert fruit.lemon == 'yellow'
assert fruit.inverse().yellow == 'lemon'
Enable debugging on what grape is doing. Install the grape tool on your Jenkins.
Set the java options to enable debugging information:
JAVA_OPTS="-Dgroovy.grape.report.downloads=true -Divy.message.logger.level=4 "
The info above comes from here:
http://docs.groovy-lang.org/latest/html/documentation/grape.html
After all new configuration I also:
- deleted .groovy/grapes/*
- restarted jenkins
Mike
Have you tried to configure a grab resolver (http://docs.groovy-lang.org/latest/html/api/groovy/lang/GrabResolver.html) ? I don't know the default resolver for grape, but maybe the default resolver does no work.
I think sometimes when dependencies are being resolved with Grapes (and perhaps other similar technologies), some flag is toggled before the dependency gets fully downloaded or configured properly. I have had this happen with Maven and Gradle as well and the problem is usually resolved by blowing away cached artifacts in .m2 or .gradle and force them to be fetched again.

Unable to create tar using ANT

I am trying to create tar and exclude file from directory roopendra
but its not seems to work. When I am trying to untar file I am getting error gzip: stdin: not in gzip format. my file exclude also not working. After running build.xml its creating tar but when I am trying to untar as below. I am using Ant version 1.9.3
Command :
$ tar -xvzf projecttar.tar.gz
Getting Error :
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
build.xml :
<?xml version="1.0"?>
<project name="testdir" default="all_task" basedir=".">
<property name="src" value="src"/>
<property name="build" value="build"/>
<property name="lib" value="lib"/>
<property name="project.dir" value="${project}/testdir" />
<target name="all_task">
<antcall target="create_directory"/>
<antcall target="create_tar"/>
</target>
<target name="create_directory">
<mkdir dir="${dist}" />
<echo message=" ${dist} directory created successfully" />
</target>
<target name="create_tar">
<tar destfile="${project}/build/projecttar.tar.gz" compression="gzip"
basedir="${project.dir}"
excludes="${project.dir}/roopendra/**"/>
</target>
</project>
Build Command :-
ant -buildfile build.xml -Ddist=/home/pathto/roop/projectRv/ -Dproject=/home/pathto/roop/
Output :-
Buildfile: /opt/apache-ant-1.9.3/build.xml
all_task:
create_directory:
[echo] /home/pathto/roop/projectRv/ directory created successfully
create_tar:
[tar] Building tar: /home/pathto/roop/build/projecttar.tar.gz
BUILD SUCCESSFUL
Total time: 0 seconds
I have already tried :
Ant not creating tar files
After run
ant -v
Output:
Apache Ant(TM) version 1.9.3 compiled on December 23 2013
Trying the default build file: build.xml
Buildfile: /opt/apache-ant-1.9.3/build.xml
Detected Java version: 1.7 in: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64/jre
Detected OS: Linux
parsing buildfile /opt/apache-ant-1.9.3/build.xml with URI = file:/opt/apache-ant-1.9.3/build.xml
Project base dir set to: /opt/apache-ant-1.9.3
parsing buildfile jar:file:/opt/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/opt/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
Property "project" has not been set
Build sequence for target(s) `all_task' is [all_task]
Complete build sequence is [all_task, create_tar, create_directory, ]
all_task:
Project base dir set to: /opt/apache-ant-1.9.3
[antcall] calling target(s) [create_directory] in build file /opt/apache-ant-1.9.3/build.xml
parsing buildfile /opt/apache-ant-1.9.3/build.xml with URI = file:/opt/apache-ant-1.9.3/build.xml
Project base dir set to: /opt/apache-ant-1.9.3
Override ignored for property "src"
Override ignored for property "build"
Override ignored for property "lib"
Property "project" has not been set
Override ignored for property "project.dir"
Build sequence for target(s) `create_directory' is [create_directory]
Complete build sequence is [create_directory, create_tar, all_task, ]
[antcall] Entering /opt/apache-ant-1.9.3/build.xml...
Build sequence for target(s) `create_directory' is [create_directory]
Complete build sequence is [create_directory, create_tar, all_task, ]
create_directory:
Property "dist" has not been set
[mkdir] Skipping /opt/apache-ant-1.9.3/${dist} because it already exists.
Property "dist" has not been set
[echo] ${dist} directory created successfully
[antcall] Exiting /opt/apache-ant-1.9.3/build.xml.
Project base dir set to: /opt/apache-ant-1.9.3
[antcall] calling target(s) [create_tar] in build file /opt/apache-ant-1.9.3/build.xml
parsing buildfile /opt/apache-ant-1.9.3/build.xml with URI = file:/opt/apache-ant-1.9.3/build.xml
Project base dir set to: /opt/apache-ant-1.9.3
Override ignored for property "src"
Override ignored for property "build"
Override ignored for property "lib"
Property "project" has not been set
Override ignored for property "project.dir"
Build sequence for target(s) `create_tar' is [create_tar]
Complete build sequence is [create_tar, create_directory, all_task, ]
[antcall] Entering /opt/apache-ant-1.9.3/build.xml...
Build sequence for target(s) `create_tar' is [create_tar]
Complete build sequence is [create_tar, create_directory, all_task, ]
create_tar:
Property "project" has not been set
Property "project" has not been set
[antcall] Exiting /opt/apache-ant-1.9.3/build.xml.
BUILD FAILED
/opt/apache-ant-1.9.3/build.xml:28: The following error occurred while executing this line:
/opt/apache-ant-1.9.3/build.xml:42: basedir does not exist!
at org.apache.tools.ant.taskdefs.Tar.execute(Tar.java:249)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Finally, I have got solution here http://www.donaldsimpson.co.uk/?p=122 . file permissions were not being preserved when Taring up a build with Ant
<target name="create_tar">
<tar destfile="${project}/build/projecttar.tar.gz" basedir="${project.dir}" longfile="gnu" compression="gzip">
<tarfileset dir="${project}/build/" filemode="755">
<include name="**/*roopendra/*.sh" />
</tarfileset>
</tar>
</target>

How to make Gradle stop trying to chmod MANIFEST.MF on an NTFS drive

I'm somewhat new at Gradle. My development PC dual-boots both Windows and Linux, and so I have an NTFS "data drive" that both OS's share, and I keep all of my development files on this drive. I have a Gradle Java project that compiles fine under Windows, but, under Linux, it fails with this error:
FAILURE: Build failed with an exception.
* What went wrong:
Could not copy MANIFEST.MF to '/(...my project path...)/build/tmp/jar/MANIFEST.MF'.
* Try:
Run with --debug option to get more log output.
* Exception is:
org.gradle.api.GradleException: Could not copy MANIFEST.MF to '/(...my project path...)/build/tmp/jar/MANIFEST.MF'.
at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:70)
at org.gradle.api.internal.file.collections.MapFileTree$FileVisitDetailsImpl.getFile(MapFileTree.java:133)
at org.gradle.api.internal.file.AbstractFileTree$1.visitFile(AbstractFileTree.java:39)
at org.gradle.api.internal.file.AbstractFileTree$FilteredFileTree$1.visitFile(AbstractFileTree.java:145)
at org.gradle.api.internal.file.collections.MapFileTree$Visit.visit(MapFileTree.java:103)
at org.gradle.api.internal.file.collections.MapFileTree.visit(MapFileTree.java:70)
at org.gradle.api.internal.file.collections.FileTreeAdapter.visit(FileTreeAdapter.java:96)
at org.gradle.api.internal.file.AbstractFileTree$FilteredFileTree.visit(AbstractFileTree.java:136)
at org.gradle.api.internal.file.AbstractFileTree.getFiles(AbstractFileTree.java:37)
at org.gradle.api.internal.file.CompositeFileCollection.getFiles(CompositeFileCollection.java:39)
at org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:60)
at org.gradle.api.internal.changedetection.state.DefaultFileSnapshotter.snapshot(DefaultFileSnapshotter.java:42)
at org.gradle.api.internal.changedetection.rules.InputFilesStateChangeRule.create(InputFilesStateChangeRule.java:33)
at org.gradle.api.internal.changedetection.rules.TaskUpToDateState.<init>(TaskUpToDateState.java:48)
at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.getStates(DefaultTaskArtifactStateRepository.java:151)
at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:72)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:45)
at org.gradle.api.internal.tasks.execution.ContextualisingTaskExecuter.execute(ContextualisingTaskExecuter.java:34)
at org.gradle.api.internal.changedetection.state.CacheLockAcquiringTaskExecuter$1.run(CacheLockAcquiringTaskExecuter.java:39)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:124)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:112)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:134)
at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
at org.gradle.api.internal.changedetection.state.CacheLockAcquiringTaskExecuter.execute(CacheLockAcquiringTaskExecuter.java:37)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:282)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.executeTask(DefaultTaskPlanExecutor.java:48)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.processTask(DefaultTaskPlanExecutor.java:34)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:27)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:89)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
at org.gradle.api.internal.changedetection.state.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:124)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:112)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:134)
at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
at org.gradle.api.internal.changedetection.state.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:48)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.Main.main(Main.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
Caused by: java.io.IOException: Failed to set file permissions 420 on file MANIFEST.MF. errno: 1
at org.gradle.internal.nativeplatform.filesystem.LibcChmod.chmod(LibcChmod.java:39)
at org.gradle.internal.nativeplatform.filesystem.GenericFileSystem.chmod(GenericFileSystem.java:67)
at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:67)
... 77 more
Googling this error turned up absolutely nothing. Of course, the reason for the error is clear enough: NTFS doesn't support UNIX file permissions (well, it technically can, but I don't have it configured that way because it messes with Windows's permissions). When I copied the project to my Linux partition and tried the compile again, it worked.
I looked through the Gradle docs, and can't seem to find any way to tell it not to set permissions on MANIFEST.MF. (Why does it even need to do that in the first place?) Of course, Gradle has a lot of options, so there may just be something I'm overlooking. Is there any way to tell it to stop trying to set permissions?
Gradle is trying to set default permissions for that file, and I can't see a way to stop it from doing that. (You could make it set different permissions, but I guess that won't help.) Under Windows/NTFS this normally works just fine, so it might be a problem with you Linux NTFS driver or configuration.
If you are able to modify your mount options, the filesystem type of fat has the quiet option. This option causes chmod/chown operations to fail silently, so Gradle thinks they succeed when they actually do nothing.
This works for fat and vfat (which inherits the quiet option) mounts, but I am not sure if ntfs mounts also inherit this option.

Groovy - Grab - download failed

I have a fresh installation of Groovy 2.1.4 and I'd like to create a script that uses HTTP builder.
I've added the following line at the top of the script:
#Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.6')
When I run the script in GroovyConsole, I get the following error:
1 compilation error:
Exception thrown
VI 01, 2013 12:15:39 ODP. org.codehaus.groovy.runtime.StackTraceUtils sanitize
WARNING: Sanitizing stacktrace:
java.lang.RuntimeException: Error grabbing Grapes -- [download failed: commons-logging#commons-logging;1.1.1!commons-logging.jar]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
... (aso) ...
java.lang.RuntimeException: Error grabbing Grapes -- [download failed: commons-logging#commons-logging;1.1.1!commons-logging.jar]
When I run the following command on the Windows command line:
grape -V resolve org.codehaus.groovy.modules.http-builder http-builder 0.6
I get the same error, i.e.:
:: problems summary ::
:::: WARNINGS
[NOT FOUND ] commons-logging#commons-logging;1.1.1!commons-logging.jar (0ms)
==== localm2: tried
file:C:\Documents and Settings\Administrator/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
Error in resolve:
Error grabbing Grapes -- [download failed: commons-logging#commons-logging;1.1.1!commons-logging.jar]
When I try to resolve commons-logging directly, via the following command:
grape -V resolve commons-logging commons-logging 1.1.1
I get the same error, i.e. not found.
When I instead try to download the latest version, i.e. 1.1.3, via the appropriate command, it works. But even after that, resolving the http-client still fails.
Where's the problem?
Try deleting ~/.m2 directory and also ~/.groovy/grapes directories.
It worked for me.
It looks like your Grape settings are set only to look in your local .m2 directory for the library. Check your grapeConfig.xml configuration file. (If you don't have one, you can create it--it should go in the same directory where your groovysh.history and grapes cache directory are created by Groovy.) You can copy the example file shown on the Groovy Grape reference page.
If that doesn't help, I would try deleting your grapes cache directory and try it again.
My problem was, groovy (v2.4.8) was looking in the maven repository fist (~/.m2/repository/) and finding the pom file but not finding the associated artifact/JAR. Instead of just moving on to the next resolver, which would have succeeded, it just gives up. The workaround would be to remove the pom file, the specific directory cache, or just temporarily rename the repository and run groovy again as other suggested. Or you could try to manually add it to the repository. But these are just temporary and you'll likely run into the issue again if you clear your groovy cache or with another dependency.
To troubleshoot this issue you can turn on verbose logging and try to manually install the dependency. So if your error is something like:
java.lang.RuntimeException: Error grabbing Grapes -- [download failed: commons-logging#commons-logging;1.1.1!commons-logging.jar, download failed: commons-codec#commons-codec;1.6!commons-codec.jar, download failed: commons-lang#commons-lang;2.4!commons-lang.jar]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
Which means your dependency is commons-logging-1.1.1.jar. You can run:
grape -V install commons-logging commons-logging 1.1.1
What ended up solving the problem for me was overriding the default configuration and setting usepoms="false" in the localm2 resolver. It works in my case because I have the pom but not the JAR, so since Ivy isn't considering the POM now and the JAR was never there to begin with, it goes onto the next resolver which does find it. So in summary:
Create this file: ~/.groovy/grapeConfig.xml
With these contents:
<ivysettings>
<settings defaultResolver="downloadGrapes"/>
<resolvers>
<chain name="downloadGrapes" returnFirst="true">
<filesystem name="cachedGrapes">
<ivy pattern="${user.home}/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
<artifact pattern="${user.home}/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision](-[classifier]).[ext]"/>
</filesystem>
<ibiblio name="localm2" root="file:${user.home}/.m2test/repository/" checkmodified="true" changingPattern=".*" changingMatcher="regexp" m2compatible="true" usepoms="false"/>
<ibiblio name="jcenter" root="https://jcenter.bintray.com/" m2compatible="true"/>
<ibiblio name="ibiblio" m2compatible="true"/>
</chain>
</resolvers>
</ivysettings>
I was tempted not to use the maven 2 cache at all, but if I removed the line, I got errors about not being able to find "localm2". Although updating it to point to fictitious directory worked.
Deleting .m2 and grapes did not resolve the issue for me as when they were repopulated, the jar was not being downloaded. In my case, I was missing xml-apis-1.3.04.jar
I eventually resolved the issue by manually downloading the jar file and copying it into ~/.m2/repository/xml-apis/xml-apis/<version>
Hopefully this is useful if simply deleting the directories isn't working.
this might help someone down the line as i faced similar issue in windows
java.lang.RuntimeException: Error grabbing Grapes -- [download failed: commons-collections#commons-collections;3.2.2!commons-collections.jar]
the required jar above was not being downloaded in C:/Users/%USER%/.groovy/grapes/common-collections/jars/ folder.
so manually downloaded the required version from https://jar-download.com/
and added in the corresponding folder
Not quite the same case as the question, adding it in case someone finds himself in a similar case with me where I did not have any direct access on the machine to check the grapeConfig.xml configuration file, as suggested by the accepted answer. What worked for me was to configure a grab resolver.
I did something similar with what is stated in the documentation and it worked (documentation link):
#GrabResolver(name='restlet', root='http://maven.restlet.org/')
#Grab(group='org.restlet', module='org.restlet', version='1.1.6')
I solved a similar issue by using a newer version of commons-codec:commons-codec in groovy script using the #Grab annotation:
#Grapes([
#Grab('org.slf4j:slf4j-simple:1.7.25'),
#Grab('commons-codec:commons-codec:1.14'),
#Grab('io.github.http-builder-ng:http-builder-ng-apache:1.0.4')
])
you need create ~/.groovy/grapeConfig.xml
coments
<ivysettings>
<settings defaultResolver="downloadGrapes"/>
<resolvers>
<chain name="downloadGrapes" returnFirst="true">
<filesystem name="cachedGrapes">
<ivy pattern="${user.home}/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
<artifact pattern="${user.home}/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision](-[classifier]).[ext]"/>
</filesystem>
<ibiblio name="localm2" root="file:${user.home}/.m2test/repository/" checkmodified="true" changingPattern=".*" changingMatcher="regexp" m2compatible="true" usepoms="false"/>
<ibiblio name="jcenter" root="https://jcenter.bintray.com/" m2compatible="true"/>
<ibiblio name="ibiblio" m2compatible="true"/>
</chain>
</resolvers>
</ivysettings>
I had a similar error when using Groovy + Java 7.
The error from groovy was:
General error during conversion: Error grabbing Grapes -- [unresolved dependency: com.microsoft.sqlserver#mssql-jdbc;6.4.0.jre7: not found]
When trying the
grape -V resolve com.microsoft.sqlserver mssql-jdbc 6.4.0.jre7
command i had these errors:
java.net.SocketException: Connection reset
javax.net.ssl.SSLException: Received fatal alert: protocol_version
The way to fix this was adding the -Dhttps.protocols=TLSv1.2 parameter:
grape -Dhttps.protocols=TLSv1.2 -V resolve com.microsoft.sqlserver mssql-jdbc 6.4.0.jre7
Then the package is downloaded and i can use it from Groovy

Resources