Now I do as follow in the "settings.xml":
   
  <profiles>
  <profile>
  <properties>
  <my.junit.version>3.8.1</my.junit.version>
  </properties>
  </profile>
  </profiles>
   
  And it runs successful when I run "mvn clean". But as I run "´mvn compile" I 
got error as follow:
   
  Downloading: 
http://repo1.maven.org/maven2/junit/junit/{my.junit.version}/junit-
{my.junit.version}.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
  Missing:
----------
1) junit:junit:jar:{my.junit.version}
    Try downloading the file manually from the project website.
    Then, install it using the command:
      mvn install:install-file -DgroupId=junit -DartifactId=junit \
          -Dversion={my.junit.version} -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
    mvn deploy:deploy-file -DgroupId=junit -DartifactId=junit \
          -Dversion={my.junit.version} -Dpackaging=jar -Dfile=/path/to/file \
           -Durl=[url] -DrepositoryId=[id]
    Path to dependency:
        1) com.wei.chen.app:TestXml:jar:1.0-SNAPSHOT
        2) junit:junit:jar:{my.junit.version}
  ----------
1 required artifact is missing.
  for artifact:
  com.wei.chen.app:TestXml:jar:1.0-SNAPSHOT
  from the specified remote repositories:
  central (http://repo1.maven.org/maven2)
  
[INFO] ------------------------------------------------------------------------
   
   
   
  ************************
  My fault: the <properties> tag must be inside a profile and not at the
<settings> level.

Jeff


On Jan 2, 2008 11:41 AM, Thomas Chang <[EMAIL PROTECTED]> wrote:

> I think you mean:
>  <properties>
>        <my.junit.group>xxxx</my.junit.group>
> </properties>
>
>  Right?
>
>  I put this at the end of "settings.xml". But I got error as I run
 mvn
> command such as mvn clean:
>  E:\Projekte\TestXml>mvn clean
> Error reading settings.xml: Unrecognised tag: 'properties' (position:
> START_TAG
> seen ...</profiles>\r\n\r\n\t<properties>... @240:14)
>  Line:   240
>  Column: 14
>  E:\Projekte\TestXml>
>
>
>  ******************
>  In your settings.xml files, insert the following code under the
>  settings
> element:
>
>     <properties>
>        <my.junit.group>xxxx</libs_project_home>
>      </properties>
>
> Jeff
>
> On Jan 2, 2008 11:12 AM, Thomas Chang <[EMAIL PROTECTED]> wrote:
>
> > Thanks for the answer.
> >
> >  Could you give an example how to set these properties in the
>  settings.xml?
> > :-/
> >
> >
> >  ***************************
> >  Maven will do it automatically if you defines theses properties in
>  your
> > setting.xml files.
> >
> > Jeff
> >
> >
> > On Jan 2, 2008 10:53 AM, Thomas Chang <[EMAIL PROTECTED]>
 wrote:
> >
> > > Hi all,
> > >
> > >  Normally the <version> in <dependency> in pom.xml look as
 follow:
> > >  <dependency>
> > >  <groupId>junit</groupId>
> > >  <artifactId>junit</artifactId>
> > >  <version>3.8.1</version>
> > >  </dependency>
> > >
> > >  Now I want to do as follow:
> > >  <dependency>
> > >  <groupId>{my.junit.group}</groupId>
> > >  <artifactId>{my.junit.artifactId}</artifactId>
> > >  <version>{my.junit.version}</version>
> > >  </dependency>
> > >
> > >  The values of {my.junit.group} etc. will be defined in an other
> >  file. Now
> > > my question: How can I configure the pom.xml so that it knows to
>  read
> > > these values from the file where the {my.junit.group} etc.
 defined?
> > >
> > >  Regards
> > >
> > >  Thomas
>
>
>
> ---------------------------------
> Jetzt Mails schnell in einem Vorschaufenster überfliegen. Dies und
 viel
> mehr bietet das  neue Yahoo! Mail.




       
---------------------------------
Beginnen Sie den Tag mit den neuesten Nachrichten. Machen Sie Yahoo! zu Ihrer 
Startseite!

Reply via email to