Building FreeMarker not resolving dependencies - ant

I'm trying to build freemarker projects and failed in first steps,
I have JDK 8 and download latest IVY (2.5.0) or recommended (2.4.0) and copy to ant lib folder, ant version is 1.10.1
I execute ant clean jar ide-dependencies and got 2 UNRESOLVED DEPENDENCIES errors:
[ivy:cachepath] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:cachepath] :: UNRESOLVED DEPENDENCIES ::
[ivy:cachepath] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:cachepath] :: ant#ant;1.6.5: not found
[ivy:cachepath] :: avalon-logkit#avalon-logkit;2.0: not found
[ivy:cachepath] ::::::::::::::::::::::::::::::::::::::::::::::
You need JDK 8 (not JDK 9!), Apache Ant (tested with 1.9.6) and Ivy (tested with 2.4.0)
Should I downgrade ant to make it work?
In Ant downgrade discouraged
Older releases of Ant can be found here. We highly recommend to not use those releases but upgrade to Ant's latest release.

It turns out, the build of 2.3.28 and earlier has this issue that if you run the build for the very first time (so you don't yet have <freemarker-project>/.ivy directory), and you run multiple Ant tasks (jar and ide-dependencies) with the same ant call, the 2nd task will corrupt the content of the newly created <freemarker-project>/.ivy. To fix that, you have to delete <freemarker-project>/.ivy, then run ant clean jar, and then separately run ant ide-dependencies.
Update: Fixed from 2.3.29-SNAPSHOT

Related

Where is the path to the downloaded jars file when Grails is resolving dependencies

Grails resolves dependencies and downloads some jars. But I can't find where the downloaded file path.
And the command locate also can't find these jars.
My Operator System is Ubuntu 16.04
It should be under ~/.gradle/caches/modules-2/files-2.1

How does grails/gradle download the dependencies without version specification

In Grails 3 project we are using some dependencies as below. For the plugin or dependencies which has version it downloads as per version specification from remote repository. We assumed it is downloading the latest dependency available when we did not mention version, but when we checked the hibernate dependency it is downloading '4.3.10.6' version in the project whereas remote repository has latest version. So how does grails or gradle download dependencies without version?
compile "org.grails.plugins:hibernate"
compile "org.grails.plugins:cache"
compile "org.hibernate:hibernate-ehcache"
compile "org.grails.plugins:scaffolding"
compile "org.webjars:bootstrap:3.3.5"
compile "org.webjars:bootstrap-tagsinput:0.5"
Note : We don't have any errors or issues with this in our project
If no version is specified, Gradle will use transitive dependency management, starting with the Gradle version number, and the packages that that Gradle version depends on. If transitive dependency management doesn't care. Then Gradle will search through the hierarchy of repositories and flat files and flat trees and dependent projects and take the latest version.

How to build the plugin with ant on mac

I found a salesforce plugin for intellij IDEA (link), and now trying to install it. The problem is, i've never done this before. So according to instruction:
How to build and install
Until the plugin is released into the IntelliJ plugins repository, you
can following these instructions for manually building and installing
the plugin from GitHub:
Update the ANT script salesforce-plugin-xml with the location of your IntelliJ IDEA install
<!--property name="idea.path" value="C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.0.2"/-->
<property name="idea.path" value="/Applications/IntelliJ IDEA 13.app"/>
Execute the 'package' target of the ANT script - this will create a salesforce-plugin-#.#.zip file in the out directory
Go into IntelliJ IDEA settings under Plugins and select "Install plugin from disk". Select the zip file and click Ok.
I downloaded a project from github, added path to idea to salesforce-plugin.xml. Then i realized that i don't have an ant to build it. I installed homebrew, installed ant, checked the version (ant appeared, ok).
Then i stuck. I tried different combinations, how to package the plugin, The last attempt is when i changed salesforce-plugin.xml to build.xml and wrote in terminal:
ant package build.xml
got:
Buildfile: /Users/cooler/Downloads/salesforce-plugin-master/build.xml
BUILD FAILED
/Users/cooler/Downloads/salesforce-plugin-master/build.xml:36: taskdef
class com.intellij.ant.Javac2 cannot be found using the classloader
AntClassLoader[]
Can you help me please to do this in right way!?
BTW, i use Mavericks
On a Mac, you need to add /Contents to the root path of the IDEA installation. For example:
<property name="idea.path" value="/Applications/IntelliJ IDEA 14.app/Contents"/>
When generating ant build scripts:
build -> generate ant build
-> check "use current idea instance for idea.home property"
Re-generate the ant build scripts. Now the build should work propertly.

Compiling with lombok using maven and java 8

I am trying to get files annotated with lombok.jar to compile with maven 3 using one of the Java 8 early access releases. I have maven configured to use the java 8 compiler. The code that I am compiling has a dependency defined for lombok 0.12 in maven central. However when I compile with maven I get the following error:
[ERROR] symbol: variable log
[ERROR] location: class Foo
[ERROR] C:.....\Foo.java:[319,33] error: cannot find symbol
I have run maven in debug mode and the classpath entry specified states that the lombok 0.12 jar file is in the classpath of the project. Additionally, I tried setting lombok.jar specifically in my classpath (and I can see in env.CLASSPATH in maven debug mode) which creates the same results.
Everything builds and compiles just fine in eclipse -- what am I doing wrong with the maven configuration/environment such that I can't get compilation to success outside of eclipse?
To answer my own question -- the issue is with the version of lombok (0.12.0) not working well with java 8. To fix, I used the cutting edge version of lombok , installed it into my local maven repo with the line
mvn install:install-file -Dfile=lombok-edge.jar -DgroupId=org.projectlombok -DartifactId=lombok-edge -Dversion=0.12.1 -Dpackaging=jar
and then changed the dependencies in my pom accordingly.
Once I did that, I was able to compile from command line maven.

Apache Ant 1.6.5 - Clean Up Unused Jars Files

I searched the forum before posting.But I could find a suitable answer.
We are using Apache Ant 1.6.5 to build our Java Enterprise Application.We are using lot of external jar files to compile & build the application.I want to clean up the unused jar files.
Is the a easy way to identify & remove the unused jars?.
Checkout the tattletale tool from Jboss.

Resources