【问题标题】:Compiling nativetoascii maven plugin编译 nativetoascii maven 插件
【发布时间】:2012-09-19 15:14:05
【问题描述】:

当我编译我的项目时,我遇到了这些问题:

Failed to execute goal org.codehaus.mojo:native2ascii-maven-plugin:1.0-alpha-1:native2ascii (default) on project ViewController: Execution default of goal org.codehaus.mojo:native2ascii-maven-plugin:1.0-alpha-1:native2ascii failed: Error starting Sun's native2ascii: sun.tools.native2ascii.Main -> [Help 1]

使用 netbeans 7.2 和 jdk 1.7.07 ,但是!!如果我使用jdk 1.6 它可以工作!

当我使用jdk 1.7 时如何编译这个??

Tnx 求助!!

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>${project.parent.groupId}</groupId>
<artifactId>ViewController</artifactId>
<packaging>war</packaging>
<version>${project.parent.version}</version>
<name>ViewController</name>
<url>${project.parent.url}</url>
<organization>
    <name>kMicro</name>
</organization>

<parent>
    <groupId>com.km.eFarmer</groupId>
    <artifactId>eFarmer</artifactId>
    <version>1.0.1-alpha1-SNAPSHOT</version>
</parent>

<dependencies>
    <dependency>
        <groupId>org.glassfish.extras</groupId>
        <artifactId>glassfish-embedded-all</artifactId>
        <version>3.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>DataModel</artifactId>
        <version>${project.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>SOAPClient</artifactId>
        <version>${project.version}</version>
        <scope>provided</scope>
    </dependency>       
    <dependency>
        <groupId>org.jboss.cache</groupId>
        <artifactId>jbosscache-core</artifactId>
        <version>3.2.7.GA</version>
    </dependency>
    <dependency>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-common-core</artifactId>
        <version>2.2.14.GA</version>
    </dependency>
    <dependency>
        <groupId>jgroups</groupId>
        <artifactId>jgroups</artifactId>
        <version>2.6.13.GA</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-core</artifactId>
        <version>3.0.2.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>3.0.2.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <version>3.0.2.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>8.4-701.jdbc4</version>
        <scope>test</scope>
    </dependency>
    <!--dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-openid</artifactId>
        <version>3.0.2.RELEASE</version>
        <scope>compile</scope>
    </dependency-->
    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>2.0.3-FCS</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>2.0.3-FCS</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.openfaces</groupId>
        <artifactId>openfaces</artifactId>
        <version>3.0.2-KM</version>
    </dependency>
    <dependency>  
        <groupId>org.primefaces</groupId>
        <artifactId>primefaces</artifactId>
        <version>3.3.1</version>
    </dependency>
    <dependency>
        <groupId>org.primefaces</groupId>
        <artifactId>primefaces-mobile</artifactId>
        <version>0.9.3</version>
    </dependency>
    <dependency>
        <groupId>org.primefaces.themes</groupId>
        <artifactId>redmond</artifactId>
        <version>1.0.5</version>
    </dependency>
    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2.1</version>
    </dependency>
    <dependency>
        <groupId>commons-beanutils</groupId>
        <artifactId>commons-beanutils</artifactId>
        <version>1.7.0</version>
    </dependency>
    <dependency>
        <groupId>commons-digester</groupId>
        <artifactId>commons-digester</artifactId>
        <version>1.8</version>
    </dependency>
    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.4</version>
    </dependency>
    <dependency>
        <groupId>cssparser</groupId>
        <artifactId>cssparser</artifactId>
        <version>0.9.5</version>
    </dependency>
    <dependency>
        <groupId>milyn</groupId>
        <artifactId>sac</artifactId>
        <version>1.3</version>
    </dependency>
    <dependency>
        <groupId>jdom</groupId>
        <artifactId>jdom</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>jfree</groupId>
        <artifactId>jfreechart</artifactId>
        <version>1.0.13</version>
    </dependency>
    <dependency>
        <groupId>jfree</groupId>
        <artifactId>jcommon</artifactId>
        <version>1.0.16</version>
    </dependency>
    <dependency>
        <groupId>jexcelapi</groupId>
        <artifactId>jxl</artifactId>
        <version>2.6</version>
    </dependency>
    <dependency>
        <groupId>net.sf.jasperreports</groupId>
        <artifactId>jasperreports</artifactId>
        <version>4.5.1</version>            
    </dependency>
    <dependency>
        <groupId>it.eng.spago</groupId>
        <artifactId>sbi-utils</artifactId>
        <version>3.3.0</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy</artifactId>
        <version>1.7.5</version>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.0</version>
    </dependency>
    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.2.2</version>
    </dependency>

    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>6.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jettison</groupId>
        <artifactId>jettison</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>freemarker</groupId>
        <artifactId>freemarker</artifactId>
        <version>2.3.9</version>
    </dependency>
</dependencies>

<build>
    <plugins>

        <!--plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>native2ascii-maven-plugin</artifactId>
            <version>1.0-alpha-1</version>
            <configuration>
                <dest>${project.build.directory}/classes</dest>
                <src>src/main/resources/locale</src>                        
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>native2ascii</goal>
                    </goals>
                    <configuration>
                        <encoding>UTF8</encoding>
                    </configuration>
                </execution>
            </executions>
        </plugin-->

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jasperreports-maven-plugin</artifactId>
            <configuration>
                <compiler>net.sf.jasperreports.compilers.JRGroovyCompiler</compiler>
                <sourceDirectory>src/main/resources/jasperReportSources</sourceDirectory>
                <outputDirectory>src/main/webapp/reports</outputDirectory>
                <xmlValidation>true</xmlValidation>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>compile-reports</goal>
                    </goals>
                    <phase>compile</phase>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>net.sf.jasperreports</groupId>
                    <artifactId>jasperreports</artifactId>
                    <version>4.5.1</version>
                </dependency>
                <dependency>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-all</artifactId>
                    <version>1.7.5</version>
                </dependency>
            </dependencies>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1-alpha-1</version>
            <configuration>
                <archive>
                    <manifest>
                        <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                    </manifest>
                </archive>
            </configuration>
        </plugin>
    </plugins>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <excludes>
                <exclude>resources/**</exclude>
            </excludes>                        
        </resource>
        <resource>
            <directory>src/main/resources/font</directory>
        </resource>
    </resources>
</build>

<properties>
    <netbeans.hint.deploy.server>gfv3ee6</netbeans.hint.deploy.server>
    <jdk.version>1.6</jdk.version>
</properties>

【问题讨论】:

  • 问:为什么要使用这么老的 maven-war-plugin(当前版本:2.2)?
  • 我不是这个项目的作者。我是新来的。您认为这可能会导致这些问题吗?
  • 我已将 maven war 插件和 nativetoascii 插件的版本更改为最新版本,效果很好!求救!

标签: maven netbeans compilation java


【解决方案1】:

将 native2ascii-maven-plugin 的版本更新到最新版本。

【讨论】:

  • 就我而言,最新版本是1.0-beta-1(之前的1.0-alpha-1)。
【解决方案2】:

添加这个对我有用: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>native2ascii-maven-plugin</artifactId> ... <!-- added for java 7 compilation --> <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.5.0</version> <scope>system</scope> <systemPath>${java.home}/../lib/tools.jar</systemPath> </dependency> </dependencies> ...

【讨论】:

    猜你喜欢
    • 2018-05-29
    • 1970-01-01
    • 1970-01-01
    • 2013-03-07
    • 1970-01-01
    • 2021-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多