ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Matèrne (jhm) <apa...@materne.de>
Subject AW: Maven Ant Plugin question
Date Thu, 27 Mar 2014 07:07:41 GMT
The problem is the usetimestamp="false" which disables the local check.
And because its hard written in the (generated) code you can't "overwrite"
that with a <presetdef>.

I did a test with this buildfile:
- usetimestamp=false: loads everytime all artifacts (just the mkdir will run
once)
- usetimestamp=true: only load the 1st time

While I dont think that changing generated code is a good idea (when you
want to regenerate that later ...) this is the best thing I can suggest ...
(Another option: tweak Ant itself: overwrite <get> to ignore the
usetimestamp-setting, ...)



Jan



<project>

  <!-- For local tests -->
  <property name="local.repo" value="test-repo"/>
  <property name="lib.dir" value="lib"/>
  
  <!-- The 'generated' code -->
  <mkdir dir="${local.repo}/commons-io/commons-io/2.4"/>
  <get
src="http://repo1.maven.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.
jar"
       dest="${local.repo}/commons-io/commons-io/2.4"
       usetimestamp="false"
       ignoreerrors="true"/>
  
  <mkdir dir="${local.repo}/commons-lang/commons-lang/2.6"/>
  <get
src="http://repo1.maven.org/maven2/commons-lang/commons-lang/2.6/commons-lan
g-2.6.jar"
       dest="${local.repo}/commons-lang/commons-lang/2.6"
       usetimestamp="false"
       ignoreerrors="true"/>

</project>



> -----Ursprüngliche Nachricht-----
> Von: hwpstorage [mailto:hwpstorage@gmail.com]
> Gesendet: Dienstag, 25. März 2014 15:30
> An: user@ant.apache.org
> Betreff: Maven Ant Plugin question
> 
> Hello,
> 
> Sorry for the crossing post.
> I tried to use maven to genterate build.xml for ant.
> Use command
>  mvn ant:ant
> will generate build.xml and maven-build.xml, which can be used by Ant.
> 
> my problem is
> everytime runs ant compile
> it will download everything from every repository.
> 
> for example, for this jar file parquet-format-1.0.0.jar I got error, it
> tries every repository.
>       [get] Getting:
> http://192.168.2.124:8081/nexus/content/groups/public//com/twitter/parq
> uet-format/1.0.0/parquet-format-1.0.0.jar
>       [get] To:
> /home/usera/.m2/repository/com/twitter/parquet-format/1.0.0/parquet-
> format-1.0.0.jar
>       [get] Getting:
> https://repository.cloudera.com/artifactory/cloudera-
> repos//com/twitter/parquet-format/1.0.0/parquet-format-1.0.0.jar
>       [get] To:
> /home/usera/.m2/repository/com/twitter/parquet-format/1.0.0/parquet-
> format-1.0.0.jar
>       [get] Error opening connection java.io.FileNotFoundException:
> https://repository.cloudera.com/artifactory/cloudera-
> repos//com/twitter/parquet-format/1.0.0/parquet-format-1.0.0.jar
>       [get] Error opening connection java.io.FileNotFoundException:
> https://repository.cloudera.com/artifactory/cloudera-
> repos//com/twitter/parquet-format/1.0.0/parquet-format-1.0.0.jar
>       [get] Error opening connection java.io.FileNotFoundException:
> https://repository.cloudera.com/artifactory/cloudera-
> repos//com/twitter/parquet-format/1.0.0/parquet-format-1.0.0.jar
>       [get] Can't get
> https://repository.cloudera.com/artifactory/cloudera-
> repos//com/twitter/parquet-format/1.0.0/parquet-format-1.0.0.jarto
> /home/usera/.m2/repository/com/twitter/parquet-format/1.0.0/parquet-
> format-1.0.0.jar
>       [get] Getting:
> http://maven.twttr.com/com/twitter/parquet-format/1.0.0/parquet-format-
> 1.0.0.jar
>       [get] To:
> /home/usera/.m2/repository/com/twitter/parquet-format/1.0.0/parquet-
> format-1.0.0.jar
>       [get] Error opening connection java.io.FileNotFoundException:
> http://maven.twttr.com/com/twitter/parquet-format/1.0.0/parquet-format-
> 1.0.0.jar
>       [get] Error opening connection java.io.FileNotFoundException:
> http://maven.twttr.com/com/twitter/parquet-format/1.0.0/parquet-format-
> 1.0.0.jar
>       [get] Error opening connection java.io.FileNotFoundException:
> http://maven.twttr.com/com/twitter/parquet-format/1.0.0/parquet-format-
> 1.0.0.jar
>       [get] Can't get
> http://maven.twttr.com/com/twitter/parquet-format/1.0.0/parquet-format-
> 1.0.0.jarto
> /home/usera/.m2/repository/com/twitter/parquet-format/1.0.0/parquet-
> format-1.0.0.jar
>       [get] Getting:
> http://repo.maven.apache.org/maven2/com/twitter/parquet-
> format/1.0.0/parquet-format-1.0.0.jar
>       [get] To:
> /home/usera/.m2/repository/com/twitter/parquet-format/1.0.0/parquet-
> format-1.0.0.jar
> 
> 
> in File  maven-build.xml, this is generated via commmand mvn ant:ant
> 
>     <mkdir dir="${maven.repo.local}/com/twitter/parquet-format/1.0.0"/>
>     <get src="
> http://192.168.2.124:8081/nexus/content/groups/public//com/twitter/parq
> uet-format/1.0.0/parquet-format-1.0.0.jar
> "
> 
> dest="${maven.repo.local}/com/twitter/parquet-format/1.0.0/parquet-
> format-1.0.0.jar"
>          usetimestamp="false"
>          ignoreerrors="true"/>
>     <get src="
> https://repository.cloudera.com/artifactory/cloudera-
> repos//com/twitter/parquet-format/1.0.0/parquet-format-1.0.0.jar
> "
> 
> dest="${maven.repo.local}/com/twitter/parquet-format/1.0.0/parquet-
> format-1.0.0.jar"
>          usetimestamp="false"
>          ignoreerrors="true"/>
>     <get src="
> http://maven.twttr.com/com/twitter/parquet-format/1.0.0/parquet-format-
> 1.0.0.jar
> "
> 
> dest="${maven.repo.local}/com/twitter/parquet-format/1.0.0/parquet-
> format-1.0.0.jar"
>          usetimestamp="false"
>          ignoreerrors="true"/>
>     <get src="
> http://repo.maven.apache.org/maven2/com/twitter/parquet-
> format/1.0.0/parquet-format-1.0.0.jar
> "
> 
> dest="${maven.repo.local}/com/twitter/parquet-format/1.0.0/parquet-
> format-1.0.0.jar"
>          usetimestamp="false"
>          ignoreerrors="true"/>
> 
> 
> In the orginal maven pom.xml file
>                 <dependency>
>                         <groupId>com.twitter</groupId>
>                         <artifactId>parquet-format</artifactId>
>                         <version>1.0.0</version>
>                 </dependency>
> 
> 
> Is there any way to change the generate file maven-build.xml in maven?
> is it possible to skip the jar download if the maven.repo.local local
> repository already has the jar file?
> 
> Thanks a lot


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message