title: Error running Spring Boot application from command line
body: <p>I have packaged a spring boot service using Maven "mvn clean package" and I am successfully able to create the jar. But when I run it from command line using below command : "java -jar \target\noentenimnininc-0.0.1-SNAPSHOT.jar" I am getting below error ::</p>
  
  <pre><code>no main manifest attribute, in noentenimnininc-0.0.1-SNAPSHOT.jar
  </code></pre>
  
  <p>this is the main class</p>
  
  <pre><code>@SpringBootApplication
  @Import({SecurityConfig.class })
  public class NoEnTenimNiCincApplication  implements CommandLineRunner {
  
      /** The application logger */
      private static final Logger LOG = LoggerFactory.getLogger(NoEnTenimNiCincApplication.class);
  
      @Autowired
      private UserService userService;
  
      @Value("${webmaster.username}")
      private String webmasterUsername;
  
      @Value("${webmaster.password}")
      private String webmasterPassword;
  
      @Value("${webmaster.email}")
      private String webmasterEmail;
  
      public static void main(String[] args) {
          SpringApplication.run(NoEnTenimNiCincApplication.class, args);
      }
  
  
      @Override
      public void run(String... args) throws Exception {
  
          User user = UserUtils.createBasicUser(webmasterUsername, webmasterEmail);
          user.setPassword(webmasterPassword);
          Set&lt;UserRole&gt; userRoles = new HashSet&lt;&gt;();
          userRoles.add(new UserRole(user, new Role(RolesEnum.ADMIN)));
          LOG.debug("Creating user with username {}", user.getUsername());
          userService.createUser(user, PlansEnum.PRO, userRoles);
          LOG.info("User {} created", user.getUsername());
      }    
  }
  </code></pre>
  
  <p>and everything works fine running the class from Eclipse -> Run As -> Java Appplication</p>
  
  <p>Here the pom.xml of this module:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;com.noentenimnicinc.iot.web&lt;/groupId&gt;
    &lt;artifactId&gt;nicinc-web&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
  
    &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;1.5.3.RELEASE&lt;/version&gt;
          &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
    &lt;/parent&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
    &lt;/properties&gt;
  
    &lt;dependencies&gt;
          &lt;!-- Spring Boot dependencies --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Test dependencies --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;uk.co.jemos.podam&lt;/groupId&gt;
              &lt;artifactId&gt;podam&lt;/artifactId&gt;
              &lt;version&gt;7.0.5.RELEASE&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- nicinc-core dependencies --&gt;
          &lt;dependency&gt;
               &lt;groupId&gt;com.noentenimnicinc.iot.core&lt;/groupId&gt;
              &lt;artifactId&gt;nicinc-core&lt;/artifactId&gt;
              &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Logging dependencies --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
              &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Webjars for JQuery and Bootstrap --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.webjars&lt;/groupId&gt;
              &lt;artifactId&gt;bootstrap&lt;/artifactId&gt;
              &lt;version&gt;3.3.7-1&lt;/version&gt;
          &lt;/dependency&gt; 
          &lt;dependency&gt;
              &lt;groupId&gt;org.webjars&lt;/groupId&gt;
              &lt;artifactId&gt;jquery&lt;/artifactId&gt;
              &lt;version&gt;3.2.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Spring Security --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.thymeleaf.extras&lt;/groupId&gt;
              &lt;artifactId&gt;thymeleaf-extras-springsecurity4&lt;/artifactId&gt;
              &lt;!-- &lt;version&gt;3.0.2.RELEASE&lt;/version&gt; --&gt;
          &lt;/dependency&gt;
  
  
     &lt;/dependencies&gt;
  
  
  &lt;/project&gt;
  </code></pre>