Intellij IDEA, build artifact using Ant? - ant

I might be missing something, but I have been struggling with this problem for some time now.
I have an Web application with Ant build script. I would like to set up an Artifact to this module, (which is the .war file, generated using ant), so that I could deploy this war file, to the configured Tomcat server.
But I am not able to figure out, how to make Intellij use my Ant script to build artifact. I see an option to Run Ant Targets, but this just runs the Ant target and Intellij then proceeds to generate Artifact, in the usual way.
Please let me know if the question is ambiguous. The problem is not Ant Integration with Intellij. I could just use the Ant window and run any target and also could make an Ant target run as part of Build. The problem is to associate an Artifact to a module and leverage the Ant script to build that artifact. I need this to enable, tight tomcat integration, Since while integrating the Tomcat server, I can specify an artifact to be deployed.
Note: Intellij IDEA version 11.1

IDEA can either deploy Artifact or the External Source (directory or file) that is built by Ant or any other tool:
It's not possible to associate IDEA Artifact with Ant build.

Related

Unable to deploy war file on to Tomcat8 in jenkins

I'm doing a project as part of DevOps certification.
I need to build a pipeline which contains around 6 steps.
In the 5th step, I need to generate a .war file (which is successful).
In the last step, i need to deploy the war file which contains artifacts on to tomcat using Jenkins.
The project keeps failing. Is that something because of incorrect configuration. Here are the attached screenshots of build, post-build actions, and the console output of project.
Build and post-build actions
console-output of the project
Where am I doing it wrong.
There's issue either while reading your dependencies from pom.xml file or there are some missing dependencies. The stack trace gives build failure in gameoflife-web module.
Try building the same module in Eclipse IDE and you'll find the same error there and you can solve this by adding proper dependencies.
This issue is not of Jenkins when the build is not successful, it will always fail.

Why is org-netbeans-modules-java-j2seproject-copylibstask.jar required failed ant build

When doing an ant build (thought jenkins) for a test project, I get the below error. As this test project will be deployed in tomcat why does the build require a netbeans specific module
Obviously I can add the jar file to a path in jenkins and then continue the build, but want to know why it needs a netbeans specific jar?
Is it because the project setup in Netbeans is wrong?
Thanks in advance.
Tony
======Error below here =========
var/lib/jenkins/workspace/DeployTest2/nbproject/build-impl.xml:797: The libs.CopyLibs.classpath property is not set up.
This property must point to
org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
of NetBeans IDE installation and is usually located at
/java/ant/extra folder.
Either open the project in the IDE and make sure CopyLibs library
exists or setup the property manually. For example like this:
ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar

Intellij's live inspection fails to find external references in ANT build files

I have a project with different modules bundled into each others.
We build with ant and I have no problem running the Ant build inside Intellij if I provide the path to the generic build files through a property (repository.dir : C:/myRepositoryFolder).
Similarly, I have no problem running my ant build in command line given I have set my environment variable ANT-OPTS with -Drepository.dir=C:/myRepositoryFolder
However, Intellij does not know where to find this folder and therefore the inspection 'Ant inspections / Ant references resolve problems' blow off on most of my build.xml.
Does anybody know where I can show Intellij where to find this folder without modifying my existent build.properties?
Thanks in advance!

What is the best approach to implement an RTC build for WebSphere

I would like to utilize the RTC (v2.x) build for Java EE projects created in RAD (v8) and deploy them on WebSphere (v7).
Independently of RTC build i am able to create all sorts of ant scripts and jython scripts to perform automated tasks. The problem is to integrate this into a single RTC build.
The path I'm on now is:
- RTC build definition calls external build command which is a ms-dos .bat file that call's the Rational Build Utility headless ant with an ant build script.
- The ant build script uses 1)projectImport 2)workspaceBuild and 3)exec to call wsadmin with a jython deploy script.
Right now the build fails because the workspaceBuild task fails because we've defined a target runtime that does not exist in the headlles ant workspace. If someone knows how to add/define a new target runtime into a headless ant workspace that would be very helpfull.
I can't help feeling that i'm on the wrong track and feel quit stuck between the different environments and I'm wondering how other people implement their RTC build for a WebSphere target.
Thanks.
There's a DeveloperWorks article that explains how to use the RAD Ant tasks in a continuous build scenario. For the target runtime, you would define that in Eclipse, export your preferences, then import them during the build using the workspacePreferenceFile Ant task with useEclipsePrefs="true". The article uses Hudson, but the same approach should work for RTC Build.

Building along with Project Dependencies in Ant

I have a Java project that is dependent on other Java projects that are siblings and there is a chain of dependencies. Each individual project has a build script written in Ant. For clarity find below a sample of the same.
EARProject depends on WebProject and EJBProject: The war file that is generated by the WebProject build and jar file that is generated by the EJBProject are needed to build the EARProject.
WebProject depends on ComponentOneProject: The jar file that is generated by the ComponentOneProject build is needed to build WebProject.
EJBProject depends on ComponentTwoProject: The jar file that is generated by the ComponentTwoProject build is needed to build EJBProject.
So, when I build the EARProject build, if the dependent war and jar have not been built yet, then it should kick-off the WebProject build and EJBProject build and if the ComponentOneProject is yet to be built, the build of ComponentOneProject needs to be kicked-off and so on.
Can someone suggest a clean method by which we can accomplish this?
Facing the same problem we at our company wrote a custom Groovy script that explores the full dependency tree ant generates the Ant build scripts based on all the .project, .classpath, .settings/* files. This wasn't as difficult as it might seem as first. This way we can build our products without (My)Eclipse on a clean CVS+JDK+Groovy virtual machine. Hope it helps..

Resources