title: Executing Swing Application based on Maven and Spring
body: <p>I have created a Maven based Swing Application included spring as well but I do not how to give this to anyone because I can't see any jar file there, Where people can click to execute a program and to show a JFrame.
  Even if I try to build using NetBeans its creating only one jar file under the target folder but when I am clicking on it its doing nothing.</p>
  
  <p>IDE Name: NetBeans 8
  Java Version 1.7</p>
  
  <p>Pasted POM.XML File and XmlConfig File for my Maven-Spring App and also added the error when I am trying to execute from CMD.</p>
  
  <h2>POM File</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.SQLDemo&lt;/groupId&gt;
  &lt;artifactId&gt;MOM-TQ&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
          &lt;version&gt;4.2.0.RELEASE&lt;/version&gt;
          &lt;type&gt;jar&lt;/type&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
          &lt;version&gt;4.2.0.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
          &lt;version&gt;4.2.0.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;5.1.36&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
          &lt;version&gt;4.2.0.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
          &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
          &lt;version&gt;1.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.6&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;maven.compiler.source&gt;1.7&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;1.7&lt;/maven.compiler.target&gt;
  &lt;/properties&gt;
  &lt;/project&gt;
  </code></pre>
  
  <h2>XML Config File:</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:context="http://www.springframework.org/schema/context"
  
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"&gt;
  
  &lt;bean id="myBasicDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
      &lt;property name="driverClassName" value="${dbDriver}"/&gt;
      &lt;property name="url" value="${dbUrl}"/&gt;
      &lt;property name="username" value="${dbUsername}"/&gt;
      &lt;property name="password" value="${dbPassword}"/&gt;
  &lt;/bean&gt;
  
  &lt;context:property-placeholder location="src/main/java/com/mom/assets/dbinfo.properties"/&gt;
  &lt;context:component-scan base-package="com.mom.tq"&gt;&lt;/context:component-scan&gt;
  
  
  &lt;context:annotation-config/&gt;
  
  &lt;bean id="reTableClass" class="com.mom.tq.RETableClass" scope="prototype"/&gt;
  &lt;bean id="reTableDAO" class="com.mom.tq.RETableDAO" scope="prototype"/&gt;
  &lt;bean id="desktopFrame" class="com.mom.tq.DesktopFrame" scope="prototype"/&gt;
  &lt;bean id="internalFrame" class="com.mom.tq.InternalFrame"  scope="prototype"/&gt;
  &lt;bean id="batchTableClass" class="com.mom.tq.BatchTableClass" scope="prototype"/&gt;
  &lt;bean id="batchTableDAO" class="com.mom.tq.BatchTableDAO" scope="prototype"/&gt;
  &lt;bean id="internalBatchForm" class="com.mom.tq.InternalBatchForm" scope="prototype"/&gt;
  &lt;bean id="internalDeleteTraineeForm" class="com.mom.tq.InternalDeleteTraineeForm" scope="prototype"/&gt;
  &lt;bean id="internalUpdateBatchForm" class="com.mom.tq.InternalUpdateBatchForm" scope="prototype"/&gt;
  &lt;bean id="internalUpdateTraineeForm" class="com.mom.tq.InternalUpdateTraineeForm" scope="prototype"/&gt;
  &lt;bean id="adminTableClass" class="com.mom.tq.AdminTableClass" scope="prototype"/&gt;
  &lt;bean id="adminTableDAO" class="com.mom.tq.AdminTableDAO" scope="prototype"/&gt;
  &lt;/beans&gt;
  </code></pre>