Hi,

I'm trying to run the native2ascii Ant task. Running 'mvn compile' I get:

java.lang.ClassNotFoundException: sun.tools.native2ascii.Main

This suggests that tools.jar isn't added to the classpath. However, I have it 
in my pom.xml:

<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>claywiki</groupId>
  <artifactId>claywiki-utils</artifactId>
  <packaging>jar</packaging>
  <version>0.0.4-SNAPSHOT</version>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <trimStackTrace>false</trimStackTrace>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>compile</id>
            <phase>compile</phase>
            <configuration>
              <tasks>
                <taskdef name="native2ascii"
                  
classname="org.apache.tools.ant.taskdefs.optional.Native2Ascii"
                  classpathref="maven.dependency.classpath">
                  <classpath>
                    <pathelement path="maven.dependency.classpath" />
                    <pathelement
                      location="${java.home}/../lib/tools.jar" />
                  </classpath>
                </taskdef>

                <native2ascii encoding="UTF-8" dest="src/test/resources"
                  src="src/test/resources" includes="**/*.UTF-8"
                  ext=".properties" />

              </tasks>

            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>ant</groupId>
            <artifactId>ant-nodeps</artifactId>
            <version>1.6.5</version>
          </dependency>
        </dependencies>
      </plugin>

    </plugins>
  </build>
</project>

Thanks,
-S.

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to