Maven,spring,tomcat7:我需要在pom.xml中正确部署什么?

时间:2015-08-10 14:01:44

标签: java spring maven tomcat

file pom.xml具有以下依赖项:

Loser <- NULL

    for (i in 1: nrow(dat)){
        if(match(dat$Team1[i],dat$Winner)==TRUE){
            Loser[i] <- cricket$Team2[i]
        }else if(match(dat$Team1[i],dat$Winner)==FALSE ){
            Loser[i] <- dat$Team1[i] 
        }
            }

以下插件:

TEAM1  TEAM2   WINNER LOSER 

A       P       A      P
I       S       I      S 
P       S       S      P
S       I       I      S
S       P       P      S
W       P       W      P
A       E       A      E
A       S       S      A
E       A       E      A

部署给了我错误:

<dependencies>
  <!-- MySQL Driver -->
  <dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.35</version>
  </dependency>

  <!-- spring -->    
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>4.1.6.RELEASE</version>
  </dependency>
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>4.1.6.RELEASE</version>           
  </dependency>    
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>4.1.6.RELEASE</version>
    <type>jar</type>
  </dependency>    
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jdbc</artifactId>
    <version>4.1.6.RELEASE</version>
  </dependency>
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>4.1.6.RELEASE</version>
    <type>jar</type>
  </dependency>    

  <!-- JSTL -->    
  <dependency>
    <groupId>javax.servlet.jsp.jstl</groupId>
    <artifactId>jstl-api</artifactId>
    <version>1.2-rev-1</version>      
  </dependency>
  <dependency>
    <groupId>taglibs</groupId>
    <artifactId>standard</artifactId>
    <version>1.1.2</version>
  </dependency>
  <dependency>
    <groupId>taglibs</groupId>
    <artifactId>fmt</artifactId>
    <version>1.1.2</version>
    <type>tld</type>
  </dependency>
</dependencies> 

我使用的是Apache Maven 3.0.5和Apache Tomcat 7.我认为依赖是可以的,而且我不确定插件。 我正在使用Netbeans。

Tomcat的users.xml中:

  <plugins>            

    <!-- tomcat -->
    <plugin>  
      <groupId>org.apache.tomcat.maven</groupId>  
      <artifactId>tomcat7-maven-plugin</artifactId>  
      <version>2.2</version>  
      <configuration>  
        <url>http://localhost:8080/manager/text</url>
        <username>admin</username>  
        <password>admin</password>
      </configuration>  
    </plugin>  
  </plugins>

1 个答案:

答案 0 :(得分:0)

一个用户不应该同时拥有manager-gui和manager-script角色。

创建两个用户:

<user username="admin" password="admin" roles="manager-script"/>
<user username="admin_gui" password="admin" roles="manager-gui"/>

此外,您可以尝试在插件配置中指定路径

 <configuration>  
        <url>http://localhost:8080/manager/text</url>
        <username>admin</username>  
        <password>admin</password>
        <path>/myAppName</path>
 </configuration>