Install ${idea.home} in build.xml file - intellij-idea

When I generate Ant build in Intellij IDEA I get error in build.xml file.
Build -> Generate Ant Build...
The error is:
C:\projectPath\my_project\${idea.home}
lib does not exist.
My question is: how can I install idea.home path in Intellij IDEA for my_project.
With kind regards.

Related

Intellij IDEA no option to import ant build file

I have a project which uses ant build tool and the project uses
IntelliJ IDEA 2021.3.1 (Community Edition)
The most frustrating and infuriating part that I'm experiencing is
a process of importing build.xml file to ant window - it just doesn't
work whatever I try. And I've tried
Importing project from git
Importing project from sources
It just seems that the option to add build.xml file as an ant build file evades me.
The most ridiculous part is when I try to press + in an ant window and add build.xml it
does not allow me to select build.xml it just fails to show build.xml at all... Why?
What have I tried?
I've tried every single option written here
How to import existing Ant build.xml into IntelliJ IDEA
My questions
How to add buil.xml file to Intellij IDEA?
Why I'm failing to add build.xml file as an ant build file while
going though ant window + option?
Why I'm missing an option (right context menu) to add build.xml
as an ant build file?
I've tried to build project using Eclipse and everything was working fine, but Intellij
just ignores ant why? Do I need Ultimate version? Is ant option available only in paid version of Intellij IDEA?
Oh, my dear God, just found out how to import ant build.xml file
First I needed to override build.xml file type (click on an ant build.xml file -> select override file type -> select XML) and then second time I've clicked the right mouse button an extra option showed add as ant build file
showed up.

Apache Ant Build output to file using only log4j

I am developing a java project using Eclipse as IDE and ant as the build tool. For logging I am making use of log4j library. I am able to get the log messages in a log file for my whole application using log4j configuration. But when I build project using ANT, the ANT build messages are still posted to console.I want to make sure that when I build the project, the build messages that ANT generates, like build failure/success, should also be posted to that sames logger file using log4j.
Please help me in this if anyone has got an idea in detail. Thanks
You can make use of Log4jListener available in ant.
Your log4j.properties file would look something like this
log4j.rootLogger=ERROR, LogFile
log4j.logger.org.apache.tools.ant.Project=INFO
log4j.logger.org.apache.tools.ant.Target=INFO
log4j.logger.org.apache.tools.ant.taskdefs=INFO
log4j.logger.org.apache.tools.ant.taskdefs.Echo=WARN
log4j.appender.LogFile=org.apache.log4j.FileAppender
log4j.appender.LogFile.layout=org.apache.log4j.PatternLayout
log4j.appender.LogFile.layout.ConversionPattern=[%6r] %8c{1} : %m%n
log4j.appender.LogFile.file=build.log
And you when you run the ant build you have to pass the listener argument as follows -
ant -listener org.apache.tools.ant.listener.Log4jListener
For the above command to work your log4j.porperites and the log4j jar sould be on the ant classpath. This way your build logs will go to both console and the file build.log

IDEA cannot compile java file in gradle project

I am build a gradle project and run compileJava task everything is ok. But i right click one java file and 'Compile xxxx.java', i get some error.
Error:(3, 25) java: package com.jpf.ms.entity not exists
...
IDEA version: 14.1.4
Make sure your settings.build references that package, and refresh your dependencies as shown here before running gradle tasks.

Intellij - build artifact

When I build a Jar in intellij (using "build artifacts...") it generates a jar that has invalid signature.
To solve it I always need to go inside the jar to META-INF folder and delete ORACLE_J.SF and ORACLE_J.RSA.
Any idea why it happens/how to solve it?

Maven packaging web application

i removed one un-used dependency from pom.xml of the project which had packaging of war kind.Even after removing it, it is getting bundled under lib folder.
Why is this so?
Appreciate your inputs
execute following command to see your actual pom
mvn help:effective-pom
or outout it to a file
mvn help:effective-pom > effective-pom.xml
now go through the generated effective-pom.xml