Olá pessoal,
Tenho uma classe simples, que importa algumas coisas do java.io , e não sei porque na hora que eu dou um mvn tomcat:deploy, ele retorna os seguintes erros:
[ERROR] Errors in ‘/home/anderson/Projetos/Articulus/src/main/java/br/org/articulus/client/GenerateMenu.java’
[ERROR] Line 3: The import java.io.BufferedWriter cannot be resolved
[ERROR] Line 4: The import java.io.File cannot be resolved
[ERROR] Line 5: The import java.io.FileOutputStream cannot be resolved
[ERROR] Line 6: The import java.io.OutputStreamWriter cannot be resolved
[ERROR] Line 7: The import java.io.Writer cannot be resolved
[ERROR] Line 9: The import org.jdom cannot be resolved
[ERROR] Line 10: The import org.jdom cannot be resolved
[ERROR] Line 11: The import org.jdom cannot be resolved
[ERROR] Line 33: File cannot be resolved to a type
[ERROR] Line 33: File cannot be resolved to a type
[ERROR] Line 52: Element cannot be resolved to a type
[ERROR] Line 52: Element cannot be resolved to a type
[ERROR] Line 54: Element cannot be resolved to a type
[ERROR] Line 54: Element cannot be resolved to a type
[ERROR] Line 55: Element cannot be resolved to a type
[ERROR] Line 55: Element cannot be resolved to a type
[ERROR] Line 56: Element cannot be resolved to a type
[ERROR] Line 56: Element cannot be resolved to a type
[ERROR] Line 57: Element cannot be resolved to a type
[ERROR] Line 57: Element cannot be resolved to a type
[ERROR] Line 59: Element cannot be resolved to a type
[ERROR] Line 59: Element cannot be resolved to a type
[ERROR] Line 60: Element cannot be resolved to a type
[ERROR] Line 60: Element cannot be resolved to a type
[ERROR] Line 61: Element cannot be resolved to a type
[ERROR] Line 61: Element cannot be resolved to a type
[ERROR] Line 62: Element cannot be resolved to a type
[ERROR] Line 62: Element cannot be resolved to a type
[ERROR] Line 63: Element cannot be resolved to a type
[ERROR] Line 63: Element cannot be resolved to a type
[ERROR] Line 64: Element cannot be resolved to a type
[ERROR] Line 64: Element cannot be resolved to a type
[ERROR] Line 65: Element cannot be resolved to a type
[ERROR] Line 65: Element cannot be resolved to a type
[ERROR] Line 66: Element cannot be resolved to a type
[ERROR] Line 66: Element cannot be resolved to a type
[ERROR] Line 67: Element cannot be resolved to a type
[ERROR] Line 67: Element cannot be resolved to a type
[ERROR] Line 68: Element cannot be resolved to a type
[ERROR] Line 68: Element cannot be resolved to a type
[ERROR] Line 69: Element cannot be resolved to a type
[ERROR] Line 69: Element cannot be resolved to a type
[ERROR] Line 70: Element cannot be resolved to a type
[ERROR] Line 70: Element cannot be resolved to a type
[ERROR] Line 163: Document cannot be resolved to a type
[ERROR] Line 163: Document cannot be resolved to a type
[ERROR] Line 167: Writer cannot be resolved to a type
[ERROR] Line 167: BufferedWriter cannot be resolved to a type
[ERROR] Line 167: OutputStreamWriter cannot be resolved to a type
[ERROR] Line 168: FileOutputStream cannot be resolved to a type
[ERROR] Line 170: XMLOutputter cannot be resolved to a type
[ERROR] Line 170: XMLOutputter cannot be resolved to a type
Finding entry point classes
[ERROR] Unable to find type ‘br.org.articulus.client.ArticulusMain’
[ERROR] Hint: Previous compiler errors may have made this type unavailable
[ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
[ERROR] Build failed
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Exception attempting compile.
Embedded error: Compilation failed.
Alguém sabe me dizer o que aconteceu? Lembrando que a classe GenerateMenu está dentro do mesmo pacote que a classe principal ArticulusMain, então não teria motivo dele não encontrar.
Grato pela ajuda.
Abraços.
Ta na mão:
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.org.articulus</groupId>
<artifactId>Articulus</artifactId>
<packaging>war</packaging>
<version>0.1-SNAPSHOT</version>
<name>Articulus Project</name>
<description>
The project proposes the construction of a biometric system of
point that can be used in any industry where it is necessary to
control the entry and exit of people.
</description>
<url>http://articulus.sourceforge.net</url>
<inceptionYear>2008</inceptionYear>
<licenses>
<license>
<name>GPL</name>
<url>http://www.gnu.org/licenses/licenses.html#GPL</url>
</license>
</licenses>
<developers>
<developer>
<id>anderson</id>
<name>Anderson Clayton</name>
<email>andersonajx@gmail.com</email>
<roles>
<role>Java Developer</role>
<role>Network Manager</role>
</roles>
<timezone>-3</timezone>
<url>http://articulus.sourceforge.net</url>
</developer>
<developer>
<id>marcia</id>
<name>Marcia Tanimoto</name>
<email>mtanimoto@gmail.com</email>
<roles>
<role>Java Developer</role>
</roles>
<timezone>-3</timezone>
<url>http://articulus.sourceforge.net</url>
</developer>
<developer>
<id>laydy</id>
<name>Sterlaydy Barbosa</name>
<email>sterlaydy@gmail.com</email>
<roles>
<role>Java Developer</role>
</roles>
<timezone>-3</timezone>
<url>http://articulus.sourceforge.net</url>
</developer>
</developers>
<contributors>
<contributor>
<name></name>
<email></email>
</contributor>
</contributors>
<!-- Bugs, changelogs, etc -->
<issueManagement>
<system></system>
<url></url>
</issueManagement>
<!-- Process definitions -->
<ciManagement>
<notifiers></notifiers>
<system></system>
<url></url>
</ciManagement>
<mailingLists>
<mailingList>
<name>Articulus List</name>
<subscribe>
articulus-developers@lists.sourceforge.net
</subscribe>
<unsubscribe>
articulus-developers@lists.sourceforge.net
</unsubscribe>
<post>articulus-developers@lists.sourceforge.net</post>
</mailingList>
</mailingLists>
<scm>
<connection>
scm:svn:https://articulus.svn.sourceforge.net/svnroot/articulus
</connection>
<developerConnection>
scm:svn:https://articulus.svn.sourceforge.net/svnroot/articulus
</developerConnection>
<url>https://articulus.svn.sourceforge.net</url>
</scm>
<repositories>
<repository>
<id>gwt-maven</id>
<url>
http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/
</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>gwt-maven</id>
<url>
http://gwt-maven.googlecode.com/svn/trunk/mavenrepo
</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<!-- Tests -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openinsula.arena</groupId>
<artifactId>arena-gwt</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.3</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>2.5.3</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>1.4.62</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>1.4.62</version>
</dependency>
<dependency>
<groupId>com.googlecode.gwtx</groupId>
<artifactId>GWTx</artifactId>
<version>20070605</version>
</dependency>
<dependency>
<groupId>jdom</groupId>
<artifactId>jdom</artifactId>
<version>b9</version>
</dependency>
</dependencies>
<build>
<finalName>articulus</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>com.totsp.gwt</groupId>
<artifactId>maven-googlewebtoolkit2-plugin</artifactId>
<configuration>
<logLevel>INFO</logLevel>
<runTarget>br.org.articulus.App/App.html</runTarget>
<!--<runTarget>localhost:8080/Articulus/App.html</runTarget>-->
<compileTargets>
<value>br.org.articulus.App</value>
</compileTargets>
<generatorRootClasses>
<value>
br.org.articulus.server.ArticulusBean
</value>
</generatorRootClasses>
<generatorDestinationPackage>
br.org.articulus.client
</generatorDestinationPackage>
<generateGettersAndSetters>
true
</generateGettersAndSetters>
</configuration>
<executions>
<execution>
<goals>
<goal>mergewebxml</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0</version>
<configuration>
<webXml>target/web.xml</webXml>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>
maven-project-info-reports-plugin
</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changelog-plugin</artifactId>
</plugin>
</plugins>
</reporting>
</project>
Como é a estrutura (árvore) do seu projeto?
Pelo jeito, o Maven não consegue encontrar seu fontes corretamente. :x
Esta é a árvore:
.
|-- GWTApplication.launch
|-- UML
| |-- ProjetoArtus.jude
| `-- ProjetoArtusUseCase.jude
|-- pom.xml
|-- src
| `-- main
| |-- java
| | `-- br
| | `-- org
| | `-- articulus
| | |-- App.gwt.xml
| | |-- client
| | | |-- ArticulusMain.java
| | | |-- GenerateMenu.java
| | | `-- cfg
| | |-- public
| | | |-- App.html
| | | `-- styles.css
| | `-- server
| |-- resources
| `-- webapp
| |-- WEB-INF
| | |-- rpc-servlet.xml
| | `-- web.xml
| `-- index.html
`-- target
|-- articulus
| |-- META-INF
| |-- WEB-INF
| | |-- classes
| | | `-- br
| | | `-- org
| | | `-- articulus
| | | |-- client
| | | | |-- ArticulusMain$1.class
| | | | `-- ArticulusMain.class
| | | `-- server
| | | `-- GenerateMenu.class
| | |-- lib
| | | |-- GWTx-20070605.jar
| | | |-- aopalliance-1.0.jar
| | | |-- arena-gwt-1.0.0-SNAPSHOT.jar
| | | |-- commons-logging-1.1.1.jar
| | | |-- gwt-servlet-1.4.62.jar
| | | |-- gwt-user-1.4.62.jar
| | | |-- jdom-b9.jar
| | | |-- spring-2.5.3.jar
| | | |-- spring-beans-2.5.3.jar
| | | |-- spring-context-2.5.3.jar
| | | |-- spring-context-support-2.5.3.jar
| | | |-- spring-core-2.5.3.jar
| | | |-- spring-web-2.5.3.jar
| | | `-- spring-webmvc-2.5.3.jar
| | |-- rpc-servlet.xml
| | `-- web.xml
| |-- br.org.articulus.App
| | |-- 22DF6C4DDDCF9AAE215C091FAD6FB938.cache.html
| | |-- 22DF6C4DDDCF9AAE215C091FAD6FB938.cache.js
| | |-- 22DF6C4DDDCF9AAE215C091FAD6FB938.cache.xml
| | |-- 3E0156C03E6B3B441F291663F7A4DF5F.cache.html
| | |-- 3E0156C03E6B3B441F291663F7A4DF5F.cache.js
| | |-- 3E0156C03E6B3B441F291663F7A4DF5F.cache.xml
| | |-- 4CECA9734CCC01BE52BE31CE72E074A9.cache.html
| | |-- 4CECA9734CCC01BE52BE31CE72E074A9.cache.js
| | |-- 4CECA9734CCC01BE52BE31CE72E074A9.cache.xml
| | |-- App.html
| | |-- BEB9D09C16B6542D98AED0409CF14338.cache.html
| | |-- BEB9D09C16B6542D98AED0409CF14338.cache.js
| | |-- BEB9D09C16B6542D98AED0409CF14338.cache.xml
| | |-- F68B9DAE0832EA68B1F89B2A0A69F5C6.cache.html
| | |-- F68B9DAE0832EA68B1F89B2A0A69F5C6.cache.js
| | |-- F68B9DAE0832EA68B1F89B2A0A69F5C6.cache.xml
| | |-- br.org.articulus.App-xs.nocache.js
| | |-- br.org.articulus.App.nocache.js
| | |-- clear.cache.gif
| | |-- gwt.js
| | |-- history.html
| | |-- hosted.html
| | `-- styles.css
| `-- index.html
|-- articulus.war
|-- classes
| `-- br
| `-- org
| `-- articulus
| |-- client
| | |-- ArticulusMain$1.class
| | |-- ArticulusMain.class
| | `-- GenerateMenu.class
| `-- server
|-- compile.sh
`-- web.xml
32 directories, 61 files
Ah, lembrando que estou usando o GWT. Não entendo porque ele não localiza os imports.
Carinha, me parece que os diretórios java e resources, deveriam estar dentro do diretório src/main. :roll:
Faça o teste.
Mas eles estão cara!!
Eu arrumei o post com a árvore de diretórios, agora dá pra entender melhor hehe.
Descobri o problema!! O GWT não conhece as classes java.io porque ele é javascript. Então eu tive que fazer tudo na parte do server, dae funcionou.
Abraços.