Hi Jiang!

This task is a bit tricky, since the antrun plugin
does come with almost no dependencies in the default
pom. This is basically a good idea, since you don't
have jars lying around which you do not use.

Specially the native2ascii is a bit dirty, since this
is a special part provided by the sun tools set and
not the jre libs itself.

Sosince, as sigi pointed out a few weeks ago,  you
have to add the needed dependency yourself.


I guess it's the com.sun.tools you have to add to your
antrun dependencies:


<plugin>
  <artifactId>maven-antrun-plugin</artifactId>
  ...
  <dependencies>
    <dependency>
      <groupId>com.sun</groupId>
      <artifactId>tools</artifactId>
     <scope>system</scope>
    
<systemPath>${java.home}/../lib/tools.jar</systemPath>
    </dependency>
  </dependencies>
</plugin>
 
lg,
strub


--- jiangshachina <[EMAIL PROTECTED]> schrieb:

> 
> Hi guys,
> I must write some resource files related to
> localization.
> On develop time, I have to write natural local
> language; on runtime,
> application must use ASCII codes.
> So I have to convert the native resource files to
> ASCII files before
> deploying.
> 
> Now, I use maven-antrun-plugin to execute Ant task
> native2ascii.
> The following is my scripts on the work,
> <plugin>
>       <groupId>org.apache.maven.plugins</groupId>
>       <artifactId>maven-antrun-plugin</artifactId>
>       <executions>
>               <execution>
>                       <id>resources</id>
>                       <phase>process-resources</phase>
>                       <configuration>
>                               <tasks>
>                                       <native2ascii reverse="true" 
> encoding="UTF8"
>                                               
> src="target/sodoperation/WEB-INF/classes"
>                                               
> dest="target/sodoperation/WEB-INF/classes"
>                                               includes="**/*zh_CN.properties" 
> />
>                               </tasks>
>                       </configuration>
>                       <goals>
>                               <goal>run</goal>
>                       </goals>
>               </execution>
>       </executions>
>       <dependencies>
>               <dependency>
>                       <groupId>ant</groupId>
>                       <artifactId>ant-antlr</artifactId>
>                       <version>1.6.5</version>
>               </dependency>
>               <dependency>
>                       <groupId>antlr</groupId>
>                       <artifactId>antlrall</artifactId>
>                       <version>2.7.4</version>
>               </dependency>
>       </dependencies>
> </plugin>
> When I run "mvn package", an error thrown,
> [ERROR] BUILD ERROR
> [INFO]
>
------------------------------------------------------------------------
> [INFO] Error executing ant tasks
> Embedded error: Could not create task or type of
> type: native2ascii.
> Ant could not find the task or a class this task
> relies upon.
> ......
> 
> I need some another jars?
> How to resolve the problem?
> Thanks in advance.
> 
> a cup of Java, cheers!
> Sha Jiang
> -- 
> View this message in context:
>
http://www.nabble.com/How-to-do-%22native2ascii%22--tf2710959s177.html#a7557862
> Sent from the Maven - Users mailing list archive at
> Nabble.com.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 



                
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to