DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • How To Approach Dependency Management in Java [Video]
  • Using Python Libraries in Java
  • Using Lombok Library With JDK 23
  • Setting Up a Local Development Environment With IntelliJ, DevContainers, and Amazon Linux 2023

Trending

  • How to Format Articles for DZone
  • My LLM Journey as a Software Engineer Exploring a New Domain
  • Microsoft Azure Synapse Analytics: Scaling Hurdles and Limitations
  • AI, ML, and Data Science: Shaping the Future of Automation
  1. DZone
  2. Coding
  3. Java
  4. Headless Setup of a Java Project with Tomcat, IntelliJ Community Edition and Tomcat Maven Plugin

Headless Setup of a Java Project with Tomcat, IntelliJ Community Edition and Tomcat Maven Plugin

Use IntelliJ Community Edition, Tomcat and Tomcat Maven Plugin.

By 
Taimur Mirza user avatar
Taimur Mirza
·
Dec. 05, 14 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
46.5K Views

Join the DZone community and get the full member experience.

Join For Free

IntelliJ is a powerful IDE for Java developers. It has an ultimate edition and community edition. The ultimate edition provides all features that any developer can expect from IDEs of these days thus it is not free.

We also have community edition which is more than sufficient for most of real life Java projects. In this tutorial I will give a walk through of typical steps to setup web-based Java project with Tomcat.

I will use following versions:

1  IntelliJ 14 Community Edition (Free version)
2  JDK 8
3  I setup this on my mac OS X Yosemite (10.10.1)


When we install IntelliJ 14 Community Edition, it needs JDK6 JRE to start so you can install it. This is bit annoying but it is not stopping us to leverage Java 8 features in our real Java project.

Now in maven pom.xml, add following

<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>myProject</path>
</configuration>
</plugin>
</plugins>
</build>

Make sure that we do not have jsp-api, el-api or jboss-el dependencies in our pom file as tomcat has these libraries already in its /lib directory.

Go to “Run” menu and click “Edit Configurations…”, click “+” icon at the top left and select “Maven” as depicted in the following diagram.

Now in the first “Parameter” tab enter “Tomcat” in the name field to recognize these settings. In the “Command Line” enter “tomcat7:run” as depicted in the following diagram.

Click “Runner” tab and provide appropriate VM options as per your need and select appropriate JRE. I chose JDK 8 and provided environment variables (optional) required for my project as depicted in the following diagram.

Click “OK”. Now click “Maven Projects” from right pane as shown in the following diagram and select tomcat7 from plugins and click reimport icon to update everything.

Finally click green “Run” button to start tomcat and access your app using http://localhost:8080/myProject.

Enjoy development with pleasure!

Java (programming language) Apache Tomcat intellij Apache Maven

Opinions expressed by DZone contributors are their own.

Related

  • How To Approach Dependency Management in Java [Video]
  • Using Python Libraries in Java
  • Using Lombok Library With JDK 23
  • Setting Up a Local Development Environment With IntelliJ, DevContainers, and Amazon Linux 2023

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: