Projeto Web Maven + Módulos + Eclipse + TOMCAT

1 resposta
L

Fala aí galera blz?

Vou tentar descrever o meu problema da melhor maneira possível:

Eu tenho um projeto Maven que tem três módulos:
- Master(projeto principal)
- Business
- DAO
- Web

Sendo que todos os módulos têm como "parent" o projeto Master, e o projeto Web tem uma dependência com Business e este tem dependência com projeto DAO.
Até ai tudo bem, mas quando eu vou rodar o projeto Web no tomcat eu consigo adicioná-lo no server (diferente de muitos que vi nos fóruns) porém quando eu vou acessá-lo no navegador sempre dá erro 404.

Eu não sei se não estou conseguindo definir a URL para o módulo WEB ou se o Tomcat não está achando o diretório target.

Vou adicionar o POM.xml dos projetos para facilitar o entendimento:

Porject Master:
<?xml version="1.0" encoding="UTF-8"?>
<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">
  <modelVersion>4.0.0</modelVersion>
  <groupId>br.com.master</groupId>
  <artifactId>Master</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>
  <modules>
  	<module>dao</module>
    <module>business</module>
    <module>web</module>
  </modules>
</project>
Project Web:
<?xml version="1.0" encoding="UTF-8"?>
<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">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>br.com.master</groupId>
    <artifactId>Master</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <artifactId>web</artifactId>
  <packaging>war</packaging>
  <name>web</name>
  
  <dependencies>
  	<dependency>
	      <groupId>br.com.master</groupId>
	      <artifactId>business</artifactId>
	      <version>0.0.1-SNAPSHOT</version>
	      <scope>compile</scope>
	</dependency>
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-web</artifactId>
		<version>3.0.5.RELEASE</version>
	</dependency>
  </dependencies>
  
  <build>
    <plugins>
      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <version>6.1.7</version>
        <configuration>
          <connectors>
            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
              <port>8888</port>
              <maxIdleTime>30000</maxIdleTime>
            </connector>
          </connectors>
          <webAppSourceDirectory>${project.build.directory}/${pom.artifactId}-${pom.version}</webAppSourceDirectory>
          <contextPath>/</contextPath>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
] Project Business:
<?xml version="1.0"?>
<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">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>br.com.master</groupId>
    <artifactId>Master</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <artifactId>business</artifactId>
  <name>business</name>
  <url>http://maven.apache.org</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    
     <dependency>
	      <groupId>br.com.master</groupId>
	      <artifactId>dao</artifactId>
	      <version>0.0.1-SNAPSHOT</version>
	      <scope>compile</scope>
	 </dependency>
  </dependencies>
</project>
Project DAO:
<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">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>br.com.master</groupId>
    <artifactId>Master</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <artifactId>dao</artifactId>
</project>

Valeu !!

1 Resposta

L

Alguém ?

Criado 30 de junho de 2013
Ultima resposta 1 de jul. de 2013
Respostas 1
Participantes 1