You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Siegfried Heintze <si...@heintze.com> on 2005/10/13 00:53:26 UTC

Wanted: Help getting first Eclipse/Maven program running

I'm running Windows 2003 server with Eclipse 3.1 and Java 1.5 and maven
1.0.2.

I'm trying to make my first program using maven work with source code at
http://jakarta.apache.org/commons/httpclient/tutorial.html execute in
eclipse. 

Is it necessary to manually add the external jar files in eclipse? This
seems really tedious. I know eclipse 3.1 is smart enough to read the ant
build.xml files to determine the dependences.

The program runs fine when I manually compile it from the command prompt
using java and javac.

I did "maven ant" and this generated a nice build.xml file. I was hoping
this would inform eclipse about the build path but no luck.

The compile targets seemed weird to me. They were largly empty except for
making directories.

I suspect I need to write some jelly scripts to compile and run this simple
program. Can someone point me to a simple tutorial on how to do this? I'm
really disappointed that "Maven, A developer's notebook" from O'Reilly does
not explain this better! If it does, maybe someone could give me a page
number.

Thanks,
Siegfried


<?xml version="1.0" encoding="UTF-8"?>
<project>
    <pomVersion>1</pomVersion>
    <name>finance_yahoo</name>
    <organization>
        <name>SIGNITEK</name>
        <url>www.SIGNITEK.com</url>
    </organization>
    <inceptionYear>2005</inceptionYear>
    <package>com.signitek.yahoo.finance</package>
    <shortDescription>Crawl finance.yahoo for recommend
stocks</shortDescription>
    <repository />
    <developers>
        <developer>
            <id>0</id>
        </developer>
    </developers>
    <dependencies>
        <dependency>
          <id>commons-httpclient</id>
          <version>3.0-rc3</version>
          <url>http://jakarta.apache.org/commons/httpclient/3.0/</url>
        </dependency>
    </dependencies>
    <build />
</project>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Wanted: Help getting first Eclipse/Maven program running

Posted by Siegfried Heintze <si...@heintze.com>.
Thanks Adrian, but I'm still having red squiggles.

I'm now trying to follow the instructions in Massol & O'Brian's "Maven
Adevelopers Notebook" page 20.

I run maven with the default template (plain old console mode java app).

I add a dependency for httpclient as per
http://jakarta.apache.org/commons/httpclient/downloads.html

<dependency>
    <id>commons-httpclient</id>
    <version>2.0.2</version>
    <url>http://jakarta.apache.org/commons/httpclient/</url>
</dependency>


I run "maven eclipse".


I type maven -Dmaven.eclipse.workspace=c:\documents and
settings\Adminstrator\workspace eclipse:add-maven-repo

I've also tried to configure MAVEN_REPO manually (as per Adrian's
suggestion).

I import the project into eclipse.

I still get the red squigglies indicating eclipse does not know how to
resolve the class names.

Can someone tell me why eclipse is not cooperating?.


Thanks,
Siegfried



> you can just add MAVEN_REPO as a java build classpath variable, point to 
> directory from within Eclipse GUI
> 
> Adrian
> 
> At 10/12/2005 04:58 PM, Siegfried Heintze wrote:
> >Thanks,
> >I tried that and I still get the red squigglies! I even tried stopping
and
> >restarting eclipse.
> >
> >Maybe I'm specifying the maven repository incorrectly. I'm just using the
> >default that maven 1.0.2 set up. Does this look like a correct value for
> >maven_repo in eclipse? (I noticed Eclipse 3.1 already had a maven_repo
> >variable, but it had no value set)(.
> >
> >C:/Documents and Settings/Administrator/.maven/repository
> >
> >Here is my c:/Documents and
> >Settings/Administrator/workspace/finance_yahoo/project.properties file --
I
> >assume this is the file they were talking about in
> >http://maven.apache.org/reference/plugins/eclipse/properties.html .
Again,
> >I'm using the defaults:
> >
> ># Project property file for finance_yahoo
> >maven.eclipse.workspace=c:\\Documents and
> >Settings\\Administrator\\workspace\\
> >
> >Woops -- that line is not supposed to have wrapped.
> >
> >Here is what I get when I use that command:
> >$ maven eclipse:add-maven-repo
> >  __  __
> >|  \/  |__ _Apache__ ___
> >| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
> >|_|  |_\__,_|\_/\___|_||_|  v. 1.0.2
> >
> >build:start:
> >
> >eclipse:add-maven-repo:
> >     [propertyfile] Creating new property file: C:\Documents and
> >Settings\Adminis
> >trator\workspace\.metadata\.plugins\org.eclipse.jdt.core\pref_store.ini
> >BUILD SUCCESSFUL
> >Total time: 1 seconds
> >Finished at: Wed Oct 12 17:44:28 MDT 2005
> >
> >
> >Administrator@king-mark /c/Documents and
> >Settings/Administrator/workspace/financ
> >e_yahoo
> >$
> >
> >
> >
> >
> >
> >
> >-----Original Message-----
> >From: Anthony Kong [mailto:anthonyk@bisinfo.com.au]
> >Sent: Wednesday, October 12, 2005 5:08 PM
> >To: 'Maven Users List'
> >Subject: RE: Wanted: Help getting first Eclipse/Maven program running
> >
> >You can take a look at the maven eclipse plugin for a start.
> >(http://maven.apache.org/reference/plugins/eclipse/goals.html)
> >
> >In partciular, the goal "eclipse:add-maven-repo" should be able to help
you
> >out to make the dependencies visible in eclipse.
> >
> >Cheers,
> >AK
> >
> >org
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 
> Regards,
> 
> Adrian Zaharie
> ParaSoft Corporation
> (888) 305-0041 x 1229 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Wanted: Help getting first Eclipse/Maven program running

Posted by Adrian Zaharie <ad...@parasoft.com>.
you can just add MAVEN_REPO as a java build classpath variable, point to 
directory from within Eclipse GUI

Adrian

At 10/12/2005 04:58 PM, Siegfried Heintze wrote:
>Thanks,
>I tried that and I still get the red squigglies! I even tried stopping and
>restarting eclipse.
>
>Maybe I'm specifying the maven repository incorrectly. I'm just using the
>default that maven 1.0.2 set up. Does this look like a correct value for
>maven_repo in eclipse? (I noticed Eclipse 3.1 already had a maven_repo
>variable, but it had no value set)(.
>
>C:/Documents and Settings/Administrator/.maven/repository
>
>Here is my c:/Documents and
>Settings/Administrator/workspace/finance_yahoo/project.properties file -- I
>assume this is the file they were talking about in
>http://maven.apache.org/reference/plugins/eclipse/properties.html . Again,
>I'm using the defaults:
>
># Project property file for finance_yahoo
>maven.eclipse.workspace=c:\\Documents and
>Settings\\Administrator\\workspace\\
>
>Woops -- that line is not supposed to have wrapped.
>
>Here is what I get when I use that command:
>$ maven eclipse:add-maven-repo
>  __  __
>|  \/  |__ _Apache__ ___
>| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
>|_|  |_\__,_|\_/\___|_||_|  v. 1.0.2
>
>build:start:
>
>eclipse:add-maven-repo:
>     [propertyfile] Creating new property file: C:\Documents and
>Settings\Adminis
>trator\workspace\.metadata\.plugins\org.eclipse.jdt.core\pref_store.ini
>BUILD SUCCESSFUL
>Total time: 1 seconds
>Finished at: Wed Oct 12 17:44:28 MDT 2005
>
>
>Administrator@king-mark /c/Documents and
>Settings/Administrator/workspace/financ
>e_yahoo
>$
>
>
>
>
>
>
>-----Original Message-----
>From: Anthony Kong [mailto:anthonyk@bisinfo.com.au]
>Sent: Wednesday, October 12, 2005 5:08 PM
>To: 'Maven Users List'
>Subject: RE: Wanted: Help getting first Eclipse/Maven program running
>
>You can take a look at the maven eclipse plugin for a start.
>(http://maven.apache.org/reference/plugins/eclipse/goals.html)
>
>In partciular, the goal "eclipse:add-maven-repo" should be able to help you
>out to make the dependencies visible in eclipse.
>
>Cheers,
>AK
>
>org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org



Regards,

Adrian Zaharie
ParaSoft Corporation
(888) 305-0041 x 1229 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Wanted: Help getting first Eclipse/Maven program running

Posted by Siegfried Heintze <si...@heintze.com>.
Thanks,
I tried that and I still get the red squigglies! I even tried stopping and
restarting eclipse.

Maybe I'm specifying the maven repository incorrectly. I'm just using the
default that maven 1.0.2 set up. Does this look like a correct value for
maven_repo in eclipse? (I noticed Eclipse 3.1 already had a maven_repo
variable, but it had no value set)(.

C:/Documents and Settings/Administrator/.maven/repository 

Here is my c:/Documents and
Settings/Administrator/workspace/finance_yahoo/project.properties file -- I
assume this is the file they were talking about in
http://maven.apache.org/reference/plugins/eclipse/properties.html . Again,
I'm using the defaults:

# Project property file for finance_yahoo
maven.eclipse.workspace=c:\\Documents and
Settings\\Administrator\\workspace\\

Woops -- that line is not supposed to have wrapped.

Here is what I get when I use that command:
$ maven eclipse:add-maven-repo
 __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0.2

build:start:

eclipse:add-maven-repo:
    [propertyfile] Creating new property file: C:\Documents and
Settings\Adminis
trator\workspace\.metadata\.plugins\org.eclipse.jdt.core\pref_store.ini
BUILD SUCCESSFUL
Total time: 1 seconds
Finished at: Wed Oct 12 17:44:28 MDT 2005


Administrator@king-mark /c/Documents and
Settings/Administrator/workspace/financ
e_yahoo
$






-----Original Message-----
From: Anthony Kong [mailto:anthonyk@bisinfo.com.au] 
Sent: Wednesday, October 12, 2005 5:08 PM
To: 'Maven Users List'
Subject: RE: Wanted: Help getting first Eclipse/Maven program running

You can take a look at the maven eclipse plugin for a start.
(http://maven.apache.org/reference/plugins/eclipse/goals.html)

In partciular, the goal "eclipse:add-maven-repo" should be able to help you
out to make the dependencies visible in eclipse. 

Cheers,
AK

org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Wanted: Help getting first Eclipse/Maven program running

Posted by Anthony Kong <an...@bisinfo.com.au>.
You can take a look at the maven eclipse plugin for a start.
(http://maven.apache.org/reference/plugins/eclipse/goals.html)

In partciular, the goal "eclipse:add-maven-repo" should be able to help you
out to make the dependencies visible in eclipse. 

Cheers,
AK

-----Original Message-----
From: Siegfried Heintze [mailto:siegfried@heintze.com] 
Sent: Thursday, 13 October 2005 8:53 AM
To: 'Maven Users List'
Subject: Wanted: Help getting first Eclipse/Maven program running

I'm running Windows 2003 server with Eclipse 3.1 and Java 1.5 and maven
1.0.2.

I'm trying to make my first program using maven work with source code at
http://jakarta.apache.org/commons/httpclient/tutorial.html execute in
eclipse. 

Is it necessary to manually add the external jar files in eclipse? This
seems really tedious. I know eclipse 3.1 is smart enough to read the ant
build.xml files to determine the dependences.

The program runs fine when I manually compile it from the command prompt
using java and javac.

I did "maven ant" and this generated a nice build.xml file. I was hoping
this would inform eclipse about the build path but no luck.

The compile targets seemed weird to me. They were largly empty except for
making directories.

I suspect I need to write some jelly scripts to compile and run this simple
program. Can someone point me to a simple tutorial on how to do this? I'm
really disappointed that "Maven, A developer's notebook" from O'Reilly does
not explain this better! If it does, maybe someone could give me a page
number.

Thanks,
Siegfried


<?xml version="1.0" encoding="UTF-8"?>
<project>
    <pomVersion>1</pomVersion>
    <name>finance_yahoo</name>
    <organization>
        <name>SIGNITEK</name>
        <url>www.SIGNITEK.com</url>
    </organization>
    <inceptionYear>2005</inceptionYear>
    <package>com.signitek.yahoo.finance</package>
    <shortDescription>Crawl finance.yahoo for recommend
stocks</shortDescription>
    <repository />
    <developers>
        <developer>
            <id>0</id>
        </developer>
    </developers>
    <dependencies>
        <dependency>
          <id>commons-httpclient</id>
          <version>3.0-rc3</version>
          <url>http://jakarta.apache.org/commons/httpclient/3.0/</url>
        </dependency>
    </dependencies>
    <build />
</project>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org