Liferay theme development using JBoss on Mac - macos

I am creating liferay themes using JBoss on my Mac. In the process of creating a theme, when I execute ant deploy on my terminal, I am getting following errors:
Buildfile:
/Users/saif/Desktop/Liferay/liferay-plugins-sdk-6.1.1/themes/g2y-b2b-theme/build.xml
[copy] Copying 1 file to /usr/share/ant/lib
BUILD FAILED
/Users/saif/Desktop/Liferay/liferay-plugins-sdk-6.1.1/themes/g2y-b2b-theme/build.xml:5:
The following error occurred while executing this line:
/Users/saif/Desktop/Liferay/liferay-plugins-sdk-6.1.1/themes/build-common-theme.xml:7:
The following error occurred while executing this line:
/Users/saif/Desktop/Liferay/liferay-plugins-sdk-6.1.1/build-common-plugin.xml:5:
The following error occurred while executing this line:
/Users/saif/Desktop/Liferay/liferay-plugins-sdk-6.1.1/build-common.xml:68:
Failed to copy
/Users/saif/Desktop/Liferay/liferay-plugins-sdk-6.1.1/lib/ecj.jar to
/usr/share/ant/lib/ecj.jar due to java.io.FileNotFoundException
/usr/share/ant/lib/ecj.jar (Permission denied)
Total time: 0 seconds
Please help me to get rid of this and proceed further. What are the steps I should take in order to do this on a Mac? Please also tell me how to set up the environment variable of ANT on a Mac.

When ant builds your theme and requires ecj.jar (the eclipse compiler for java) it typically downloads it from some internet repository and places it in $ANT_HOME/lib. It seems your $ANT_HOME is usr/share/ant and you don't have write access to that directory. Either download it manually and place it there or open up the directory write permissions for one build (then close it again).
You'll only need to do this once: When ecj.jar is on the classpath for ant, it will just be used for eternity.

Related

Maven failed to clean project while building a second time

I'm facing a very strange behavior on my laptop...
I have a maven project (loaded with Visual Studio Code) building a WAR file to be deployed on a remote server.
Project compilation worked properly since yesterday but today, I'm only able to launch only once the clean install...until I reboot my laptop...
here is the command launched (the second time which cause the error):
mvn clean
....
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean (default-clean) on project my-backend: Failed to clean project: Failed to delete M:\dev\my-backend\target\my-backend\WEB-INF\lib\plexus-utils-3.3.0.jar -> [Help 1]
I'm trying to delete the target folder manually but It seems that there is another program who access this folder but I do not have anything running on my laptop, no server, no IDE (I Stopped Visual Studio Code).
I even tried to close every windows (even GitBash used to launch mvn commands) but I'm still getting this lock file issue....the only solution is to reboot my laptop !
since yesterday I didn't change anything on my pom.xml file...I'm really stucked...
EDIT 1:
I also checked with other Maven Projects I have and I'm getting the same result. After reboot I can build (mvn clean and mvn install) without any problem but at the end of the build, Windows is adding a lock on the files target/my-backend/WEB-INF/lib
Even if I try to unlock the lib folder (with UnlockIT for instance) the unlock cannot be performed and there is no process handling the lock...
any idea why I'm getting this lock and how to remove it ?

Could not download org.springframework.vault

I am importing the gradle project in eclipse which is the spring boot application. I could see all the dependency jars are downloaded except "org.springframework.vault".
I could download the spring-vault-core-2.0.1.RELEASE.pom file from browser, so no network issues i guess.
When i checked in D:\softwares\gradle-4.6-bin\gradle-4.6\caches\modules-2\files-2.1 i could not find this directory. I tried to create this directory but i got the error pop up says "folder/file in it is open in other program". I have restarted the pc, also killed all the java process and tried to create this dir, but still failed.
I deleted the cache directory itself and did gradle build, it downloaded the jars freshly except the mentioned one.
code cannot be shared as it is working project.
when i ran the application getting the error
FAILURE: Build failed with an exception.
What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
Could not resolve org.springframework.vault:spring-vault-core:2.0.1.RELEASE.
Required by:
project : > com.gogoair.ps:xauth-security:2.0.4
Could not resolve org.springframework.vault:spring-vault-core:2.0.1.RELEASE.
Could not get resource 'https://jcenter.bintray.com/org/springframework/vault/spring-vault-core/2.0.1.RELEASE/spring-vault-core-2.0.1.RELEASE.pom'.
Failed to move file 'C:\Users\CHE32904\AppData\Local\Temp\gradle_download5901172107951949118bin' into filestore at 'D:\softwares\gradle-4.6-bin\gradle-4.6\caches\modules-2\files-2.1\org.springframework.vault\spring-vault-core\2.0.1.RELEASE\562973b9fcc1880af51f50b2d1a53cf8b9f2745c\spring-vault-core-2.0.1.RELEASE.pom'
Failed to create parent directory 'D:\softwares\gradle-4.6-bin\gradle-4.6\caches\modules-2\files-2.1\org.springframework.vault' when creating directory 'D:\softwares\gradle-4.6-bin\gradle-4.6\caches\modules-2\files-2.1\org.springframework.vault\spring-vault-core\2.0.1.RELEASE\562973b9fcc1880af51f50b2d1a53cf8b9f2745c'

Crafter 3 Gradle bundle error

I am using Crafter 3.0.2 and trying to create deployable bundles through the gradle tooling provided by the craftercms project.
When executing gradlew build deploy bundle -Pcrafter.profile=true, I received the error message:
FAILURE: Build failed with an exception.
* Where:
Build file 'build.gradle' line: 774
* What went wrong:
Execution failed for task ':zipauthoring'.
> archive's size exceeds the limit of 4GByte.
The gradle suggestion following the error above is to enable zip64. So I added zip64 true to the build.gradle pack method's tasks.create("zip${envName}", Zip.class) {, and the bundle task completed successfully.
However, this approach seemed a little invasive. What is the proper procedure for producing a Crafter 3 bundle with profile enabled? If zip64 is to be used for the authoring bundle, is there a command line option that can be provided instead of editing build.gradle? Alternatively, is there a mechanism for creating only the tar.gz archive (which does not appear to have the 4gb file limitation) instead of the zip archive?
There is a ticket now to allow the users to select the bundle they want: https://github.com/craftercms/craftercms/issues/1669
I've never seen a bundle exceed 600MB, you're pushing up against 4GB which is very unusual. While adding 64bit will help it push on, there might be another issue at play here.

Error: Could not find or load main class org.gradle.launcher.GradleMain

I'm new to Gradle and while trying to install Gradle in my PC with Windows OS, I got the below mentioned error
Error: Could not find or load main class org.gradle.launcher.GradleMain
Only thing I did is that I followed the gradle installation steps given in gradle site Gradle installation and typed
gradle -v
in command prompt and I got the above mentioned exception. Any clue as to what had happened and how to resolve it.
This is what I have done :
Downloaded the zip file
Copied 'gradle-3.5' from the zip file to a folder I created in C drive (C:\Gradle)
Set GRADLE_HOME to 'C:\Gradle\gradle-3.5'
Set Path to '%GRADLE_HOME%\bin'
Opened cmd and typed gradle -v and got this error
I stopped all gradle daemons by running ./gradlew --stop and the error was resolved for me.
Basically this means that Gradle can't find your gradle/wrapper/gradle-wrapper.jar.
You have to follow Step 3 and setup environment variables:
Microsoft Windows users
In File Explorer right-click on the This PC (or Computer) icon, then
click Properties -> Advanced System Settings -> Environmental
Variables.
Under System Variables select Path, then click Edit. Add an entry for
C:\Gradle\gradle-3.5\bin. Click OK to save.
Source: https://gradle.org/install#configure
The easiest way, is to simply use gradlew.bat in your project and it will auto download Gradle for you!
I had the same issue after I removed the cache, the Gradle worker was running and I was getting this error
Error: Could not find or load main class worker.org.gradle.process.internal.worker.GradleWorkerMain
Steps I performed to resolve the error
Use gradle --stop or ./gradlew --stop
Delete the workerMain.lock file under $USER/.gradle/caches/version/workerMain
re-run the Gradle command

Trying to compile an XCode project with a workspace on Jenkins slave

I got a Jenkins slave building single xcode projects, working perfectly.
However, I got a project with a workspace where some 3rd party files are setup in the root of the workspace with a gitmodule then imported in to the project as described here.
When Jenkins compiles and reaches AppDelegate.h it throws and error when trying to import a file from the library.
fatal error: 'RestKit/Restkit.h' file not found #import <RestKit/Restkit.h>
I got the project compiling by pointing to the workspace. However it now fails when reaches the packaging stage. I don't see the build directory created in the workspace.
** BUILD SUCCEEDED **
Cannot remove *.ipa files from a non-existing directory:
/Users/leon/Work/projects/wearehive/flatstr/build/Flatstr/dev/jenkins/workspace/Snug-debuOLD/build/Debug-iphoneos
Packaging IPA
FATAL: null
java.lang.NullPointerException
at au.com.rayh.XCodeBuilder.perform(XCodeBuilder.java:421)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:705)
at hudson.model.Build$RunnerImpl.build(Build.java:178)
at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:475)
at hudson.model.Run.run(Run.java:1434)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:239)
Your Project=>build settings=>Header Search Paths, add follow path:
"$(SOURCE_ROOT)/RestKit/Build/Headers"
Be sure checked box in front of them.
I use xcode plugin and use this for SYMROOT value instead of space fixes the problem.
${workspace}/build/[app name]/Build/Products

Resources