[prev in list] [next in list] [prev in thread] [next in thread] 

List:       groovy-dev
Subject:    [groovy-dev] Re: [GMaven] Unable to find class at compile
From:       Joćo_Paulo_Mafra <jpmneofito () gmail ! com>
Date:       2009-01-22 12:03:25
Message-ID: ca52ed800901220403r32007928pe4189b8ad6c34428 () mail ! gmail ! com
[Download RAW message or body]

Hi,

I was using an incorrect HtmlUnit jar in my project. Sorry.

It was a very embaracing mistake  :'(


Joao Paulo



2009/1/21 Joćo Paulo Mafra <jpmneofito@gmail.com>

> Hi all,
>
> First, sorry for sendind to this list, I get an error while trying to
> subscribe to "user@groovy.codehaus.org".
>
> About my problem, I have a gmaven project, only with groovy sources, and
> dependencies with HtmlUnit. HtmlUnit and all its dependencies are in my
> local repo, but when I run "mvn compile" it gives me an error, like below:
>
>
> =============================================================================
>
> =============================================================================
> [INFO] Scanning for projects...
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Example Project
> [INFO]
> [INFO] Id: com.mafra:EasyHtmlUnit:jar:0.1
> [INFO] task-segment: [test]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:compile]
> [INFO] No sources to compile
> [INFO] [groovy:compile]
> [ERROR]
>
> The following mojo encountered an error while executing:
> Group-Id: org.codehaus.groovy.maven
> Artifact-Id: gmaven-plugin
> Version: 1.0-rc-4
> Mojo: compile
> brought in via: POM
>
> While building project:
> Group-Id: com.mafra
> Artifact-Id: EasyHtmlUnit
> Version: 0.1
> From file: F:\Projetos\EasyHtmlUnit\pom.xml
> Reason: startup failed,
> /F:/Projetos/EasyHtmlUnit/src/main/groovy/com/mafra/easyHtmlUnit/Browser.groovy:
> 11: unable to resolve class WebClient
>  @ line 11, column 2.
>        WebClient client
>     ^
> /F:/Projetos/EasyHtmlUnit/src/main/groovy/com/mafra/easyHtmlUnit/Browser.groovy:
> 11: unable to resolve class WebClient
>  @ line 11, column 2.
>        WebClient client
>     ^
> /F:/Projetos/EasyHtmlUnit/src/main/groovy/com/mafra/easyHtmlUnit/Browser.groovy:
> 16: unable to resolve class WebClient
>  @ line 16, column 10.
>            page = client.getPage(endereco)
>             ^
> /F:/Projetos/EasyHtmlUnit/src/main/groovy/com/mafra/easyHtmlUnit/Browser.groovy:
> 19: unable to resolve class WebClient
>  @ line 19, column 3.
>            client.alertHandler = new CollectingAlertHandler(alerts)
>      ^
> /F:/Projetos/EasyHtmlUnit/src/main/groovy/com/mafra/easyHtmlUnit/Browser.groovy:
> 19: unable to resolve class CollectingAlertHandler
>  @ line 19, column 25.
>            client.alertHandler = new CollectingAlertHandler(alerts)
>                            ^
> /F:/Projetos/EasyHtmlUnit/src/main/groovy/com/mafra/easyHtmlUnit/Browser.groovy:
> 40: unable to resolve class WebClient
>  @ line 40, column 3.
>            client.closeAllWindows()
>      ^
> /F:/Projetos/EasyHtmlUnit/src/main/groovy/com/mafra/easyHtmlUnit/Browser.groovy:
> 41: unable to resolve class WebClient
>  @ line 41, column 3.
>            client = null
>      ^
>
> 7 errors
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 2 seconds
> [INFO] Finished at: Wed Jan 21 17:56:06 BRST 2009
> [INFO] Final Memory: 3M/18M
> [INFO]
> ------------------------------------------------------------------------
>
> =============================================================================
>
> =============================================================================
>
>
> Class "WebClient" should be in HtmlUnit's jars, but gmaven doesn't find it.
> I'm using m2eclipse eclipse plugin, and it shows all HtmlUnit required jar's
> in section "Maven Dependencies" of my project. Below is my project's
> pom.xml:
>
>
>
> =============================================================================
>
> =============================================================================
> <?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>com.mafra</groupId>
>     <artifactId>EasyHtmlUnit</artifactId>
>     <name>Example Project</name>
>     <version>0.1</version>
>
>     <dependencies>
>         <dependency>
>             <groupId>org.codehaus.groovy.maven.runtime</groupId>
>             <artifactId>gmaven-runtime-1.5</artifactId>
>             <version>1.0-rc-4</version>
>         </dependency>
>
>         <dependency>
>             <groupId>junit</groupId>
>             <artifactId>junit</artifactId>
>             <version>3.8.1</version>
>             <scope>test</scope>
>         </dependency>
>
>         <dependency>
>             <groupId>net.sourceforge.htmlunit</groupId>
>             <artifactId>htmlunit</artifactId>
>             <version>2.3</version>
>         </dependency>
>     </dependencies>
>
>     <build>
>         <plugins>
>             <plugin>
>                 <groupId>org.codehaus.groovy.maven</groupId>
>                 <artifactId>gmaven-plugin</artifactId>
>                 <version>1.0-rc-4</version>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>compile</goal>
>                             <goal>testCompile</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
>     </build>
>
> </project>
>
> =============================================================================
>
> =============================================================================
>
>
> Thanks,
>
>
> Joao Paulo
>
>

[Attachment #3 (text/html)]

Hi,<br><br>I was using an incorrect HtmlUnit jar in my project. Sorry.<br><br>It was \
a very embaracing mistake&nbsp; :&#39;(<br><br><br>Joao Paulo<br><br><br><br><div \
class="gmail_quote">2009/1/21 Joćo Paulo Mafra <span dir="ltr">&lt;<a \
href="mailto:jpmneofito@gmail.com">jpmneofito@gmail.com</a>&gt;</span><br> \
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); \
margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi all,<br><br>First, sorry for \
sendind to this list, I get an error while trying to subscribe to &quot;<a \
href="mailto:user@groovy.codehaus.org" \
target="_blank">user@groovy.codehaus.org</a>&quot;.<br> <br>About my problem, I have \
a gmaven project, only with groovy sources, and dependencies with HtmlUnit. HtmlUnit \
and all its dependencies are in my local repo, but when I run &quot;mvn compile&quot; \
it gives me an error, like below:<br>

<br>=============================================================================<br>= \
============================================================================<br>[INFO] \
Scanning for projects...<br>[INFO] \
------------------------------------------------------------------------<br>

[INFO] Building Example Project<br>[INFO] <br>[INFO] Id: \
com.mafra:EasyHtmlUnit:jar:0.1<br>[INFO] task-segment: [test]<br>[INFO] \
------------------------------------------------------------------------<br>[INFO] \
[resources:resources]<br>

[INFO] Using default encoding to copy filtered resources.<br>[INFO] \
[compiler:compile]<br>[INFO] No sources to compile<br>[INFO] \
[groovy:compile]<br>[ERROR] <br><br>The following mojo encountered an error while \
executing:<br>

Group-Id: org.codehaus.groovy.maven<br>Artifact-Id: gmaven-plugin<br>Version: \
1.0-rc-4<br>Mojo: compile<br>brought in via: POM<br><br>While building \
project:<br>Group-Id: com.mafra<br>Artifact-Id: EasyHtmlUnit<br>Version: 0.1<br>

From file: F:\Projetos\EasyHtmlUnit\pom.xml<br>Reason: startup failed, \
/F:/Projetos/EasyHtmlUnit/src/main/groovy/com/mafra/easyHtmlUnit/Browser.groovy: 11: \
unable to resolve class WebClient <br>&nbsp;@ line 11, column 2.<br>&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; WebClient client<br>

&nbsp;&nbsp;&nbsp; ^<br>/F:/Projetos/EasyHtmlUnit/src/main/groovy/com/mafra/easyHtmlUnit/Browser.groovy: \
11: unable to resolve class WebClient <br>&nbsp;@ line 11, column 2.<br>&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; WebClient client<br>&nbsp;&nbsp;&nbsp; \
^<br>/F:/Projetos/EasyHtmlUnit/src/main/groovy/com/mafra/easyHtmlUnit/Browser.groovy: \
16: unable to resolve class WebClient <br>

&nbsp;@ line 16, column 10.<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
page = client.getPage(endereco)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
^<br>/F:/Projetos/EasyHtmlUnit/src/main/groovy/com/mafra/easyHtmlUnit/Browser.groovy: \
19: unable to resolve class WebClient <br>&nbsp;@ line 19, column 3.<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; client.alertHandler = new \
CollectingAlertHandler(alerts)<br>&nbsp;&nbsp;&nbsp;&nbsp; \
^<br>/F:/Projetos/EasyHtmlUnit/src/main/groovy/com/mafra/easyHtmlUnit/Browser.groovy: \
19: unable to resolve class CollectingAlertHandler <br>&nbsp;@ line 19, column \
25.<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; client.alertHandler = new \
CollectingAlertHandler(alerts)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
^<br>/F:/Projetos/EasyHtmlUnit/src/main/groovy/com/mafra/easyHtmlUnit/Browser.groovy: \
40: unable to resolve class WebClient <br>

&nbsp;@ line 40, column 3.<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
client.closeAllWindows()<br>&nbsp;&nbsp;&nbsp;&nbsp; \
^<br>/F:/Projetos/EasyHtmlUnit/src/main/groovy/com/mafra/easyHtmlUnit/Browser.groovy: \
41: unable to resolve class WebClient <br>&nbsp;@ line 41, column 3.<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; client = \
null<br>&nbsp;&nbsp;&nbsp;&nbsp; ^<br><br>7 errors<br><br>[INFO] \
------------------------------------------------------------------------<br>[INFO] \
For more information, run with the -e flag<br>[INFO] \
------------------------------------------------------------------------<br>

[INFO] BUILD FAILED<br>[INFO] \
------------------------------------------------------------------------<br>[INFO] \
Total time: 2 seconds<br>[INFO] Finished at: Wed Jan 21 17:56:06 BRST 2009<br>[INFO] \
Final Memory: 3M/18M<br>

[INFO] ------------------------------------------------------------------------<br>=============================================================================<br>
 =============================================================================<br><br><br>Class \
&quot;WebClient&quot; should be in HtmlUnit&#39;s jars, but gmaven doesn&#39;t find \
it. I&#39;m using m2eclipse eclipse plugin, and it shows all HtmlUnit required \
jar&#39;s in section &quot;Maven Dependencies&quot; of my project. Below is my \
project&#39;s pom.xml:<br>

<br><br>=============================================================================<br>
 =============================================================================<br>&lt;?xml \
version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br><br>&lt;project \
xmlns=&quot;<a href="http://maven.apache.org/POM/4.0.0" \
target="_blank">http://maven.apache.org/POM/4.0.0</a>&quot;<br>

&nbsp;&nbsp;&nbsp; xmlns:xsi=&quot;<a \
href="http://www.w3.org/2001/XMLSchema-instance" \
target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&quot;<br>&nbsp;&nbsp;&nbsp; \
xsi:schemaLocation=&quot;<a href="http://maven.apache.org/POM/4.0.0" \
target="_blank">http://maven.apache.org/POM/4.0.0</a> <a \
href="http://maven.apache.org/maven-v4_0_0.xsd" \
target="_blank">http://maven.apache.org/maven-v4_0_0.xsd</a>&quot;&gt;<br>

&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; \
&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;<br>&nbsp;&nbsp;&nbsp; \
<br>&nbsp;&nbsp;&nbsp; &lt;groupId&gt;com.mafra&lt;/groupId&gt;<br>&nbsp;&nbsp;&nbsp; \
&lt;artifactId&gt;EasyHtmlUnit&lt;/artifactId&gt;<br>&nbsp;&nbsp;&nbsp; \
&lt;name&gt;Example Project&lt;/name&gt;<br>

&nbsp;&nbsp;&nbsp; &lt;version&gt;0.1&lt;/version&gt;<br>&nbsp;&nbsp;&nbsp; \
<br>&nbsp;&nbsp;&nbsp; &lt;dependencies&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;dependency&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;groupId&gt;org.codehaus.groovy.maven.runtime&lt;/groupId&gt;<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;artifactId&gt;gmaven-runtime-1.5&lt;/artifactId&gt;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;version&gt;1.0-rc-4&lt;/version&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;/dependency&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &lt;dependency&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &lt;groupId&gt;junit&lt;/groupId&gt;<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;artifactId&gt;junit&lt;/artifactId&gt;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;version&gt;3.8.1&lt;/version&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &lt;scope&gt;test&lt;/scope&gt;<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &lt;/dependency&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;dependency&gt;<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;groupId&gt;net.sourceforge.htmlunit&lt;/groupId&gt;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;artifactId&gt;htmlunit&lt;/artifactId&gt;<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;version&gt;2.3&lt;/version&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;/dependency&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/dependencies&gt;<br>&nbsp;&nbsp;&nbsp; \
<br>&nbsp;&nbsp;&nbsp; &lt;build&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;plugins&gt;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;plugin&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &lt;groupId&gt;org.codehaus.groovy.maven&lt;/groupId&gt;<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;artifactId&gt;gmaven-plugin&lt;/artifactId&gt;<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;version&gt;1.0-rc-4&lt;/version&gt;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;executions&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;execution&gt;<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &lt;goals&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &lt;goal&gt;compile&lt;/goal&gt;<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;goal&gt;testCompile&lt;/goal&gt;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/goals&gt;<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;/execution&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &lt;/executions&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &lt;/plugin&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&lt;/plugins&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/build&gt;<br><br>&lt;/project&gt;<br>

=============================================================================<br>
=============================================================================<br><br><br>Thanks,<br><br><br>Joao \
Paulo<br><br> </blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic