• <bdo id='yIFgu'></bdo><ul id='yIFgu'></ul>
    <tfoot id='yIFgu'></tfoot>

    <small id='yIFgu'></small><noframes id='yIFgu'>

    <legend id='yIFgu'><style id='yIFgu'><dir id='yIFgu'><q id='yIFgu'></q></dir></style></legend>

  1. <i id='yIFgu'><tr id='yIFgu'><dt id='yIFgu'><q id='yIFgu'><span id='yIFgu'><b id='yIFgu'><form id='yIFgu'><ins id='yIFgu'></ins><ul id='yIFgu'></ul><sub id='yIFgu'></sub></form><legend id='yIFgu'></legend><bdo id='yIFgu'><pre id='yIFgu'><center id='yIFgu'></center></pre></bdo></b><th id='yIFgu'></th></span></q></dt></tr></i><div id='yIFgu'><tfoot id='yIFgu'></tfoot><dl id='yIFgu'><fieldset id='yIFgu'></fieldset></dl></div>

    1. Maven 3 工件问题

      Maven 3 Artifact problem(Maven 3 工件问题)

          <bdo id='iJRrj'></bdo><ul id='iJRrj'></ul>
          <i id='iJRrj'><tr id='iJRrj'><dt id='iJRrj'><q id='iJRrj'><span id='iJRrj'><b id='iJRrj'><form id='iJRrj'><ins id='iJRrj'></ins><ul id='iJRrj'></ul><sub id='iJRrj'></sub></form><legend id='iJRrj'></legend><bdo id='iJRrj'><pre id='iJRrj'><center id='iJRrj'></center></pre></bdo></b><th id='iJRrj'></th></span></q></dt></tr></i><div id='iJRrj'><tfoot id='iJRrj'></tfoot><dl id='iJRrj'><fieldset id='iJRrj'></fieldset></dl></div>
          <legend id='iJRrj'><style id='iJRrj'><dir id='iJRrj'><q id='iJRrj'></q></dir></style></legend>
            <tbody id='iJRrj'></tbody>
          • <tfoot id='iJRrj'></tfoot>

              <small id='iJRrj'></small><noframes id='iJRrj'>

              1. 本文介绍了Maven 3 工件问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我使用 struts2-archtype-starter 在 eclipse 中创建了一个新的 struts 项目.

                I made a new struts project in eclipse using the struts2-archtype-starter.

                在我做任何事情之前,我的项目中已经出现了一些错误.解决了大部分问题,但有 1 个仍然给我一些问题.

                A few errors where in my project already before doing anything. Solved most of them but there is 1 the still give me some problems.

                缺少工件 com.sun:tools:jar:1.5.0:system pom.xml

                我尝试手动将 tools.jar 添加到我的存储库,但这并没有解决问题.

                I tried to add the tools.jar to my repository manually but that didn't solve the issue.

                我的 pom 是这样的

                My pom looks like this

                <?xml version="1.0" encoding="UTF-8" ?>
                
                <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>com.divespot</groupId>
                    <artifactId>website</artifactId>
                    <packaging>war</packaging>
                    <version>0.0.1-SNAPSHOT</version>
                    <name>E-Divespot diving community</name>
                    <url>http://www.e-divespot.com</url>
                    <description>A website to support divers from all around the world.</description>
                
                    <dependencies>
                        <!-- Junit -->
                        <dependency>
                            <groupId>junit</groupId>
                            <artifactId>junit</artifactId>
                            <version>4.8.2</version>
                            <scope>test</scope>
                        </dependency>
                
                        <!--  Struts 2 -->
                        <dependency>
                            <groupId>org.apache.struts</groupId>
                            <artifactId>struts2-core</artifactId>
                            <version>2.0.11.2</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.struts</groupId>
                            <artifactId>struts2-sitemesh-plugin</artifactId>
                            <version>2.0.11.2</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.struts</groupId>
                            <artifactId>struts2-spring-plugin</artifactId>
                            <version>2.0.11.2</version>
                        </dependency>
                
                        <!-- Servlet & Jsp -->
                        <dependency>
                            <groupId>javax.servlet</groupId>
                            <artifactId>servlet-api</artifactId>
                            <version>2.4</version>
                            <scope>provided</scope>
                        </dependency>
                        <dependency>
                            <groupId>javax.servlet</groupId>
                            <artifactId>jsp-api</artifactId>
                            <version>2.0</version>
                            <scope>provided</scope>
                        </dependency>
                
                        <!-- Jakarta Commons -->
                        <dependency>
                            <groupId>commons-fileupload</groupId>
                            <artifactId>commons-fileupload</artifactId>
                            <version>1.1.1</version>
                        </dependency>
                
                        <!-- Dwr -->
                        <dependency>
                            <groupId>uk.ltd.getahead</groupId>
                            <artifactId>dwr</artifactId>
                            <version>1.1-beta-3</version>
                        </dependency>
                    </dependencies>
                
                    <build>
                      <finalName>website</finalName>
                        <plugins>
                            <plugin>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <configuration>
                                   <source>1.6</source>
                                   <target>1.6</target>
                                </configuration>
                            </plugin>
                            <plugin>
                                <groupId>org.mortbay.jetty</groupId>
                                <artifactId>maven-jetty-plugin</artifactId>
                                <version>6.1.5</version>
                                <configuration>
                                    <scanIntervalSeconds>10</scanIntervalSeconds>
                                </configuration>
                            </plugin>
                        </plugins>
                    </build>
                </project>
                

                推荐答案

                您看到的错误可能是因为您没有正确设置 JAVA_HOME 路径.您是否看到类似 C:{directories to jre}..lib ools.jar 的内容?

                The error you are seeing is probably because you dont have your JAVA_HOME path set up correctly. Are you seeing something like C:{directories to jre}..lib ools.jar?

                您可以通过更改 eclipse.ini 并添加类似的内容来使用内置的 JDK 启动 eclipse

                You can have eclipse start up using your built in JDK by altering the eclipse.ini and adding something like

                -vm
                C:{directories to JDK}injavaw.exe
                

                我了解到的是eclipse默认会使用你的系统jre来启动eclipse.您可能在启动 eclipse 时看到类似Eclipse 在 JRE 下运行并且 m2eclipse 需要 JDK 某些插件将无法工作"的消息

                What I have learned is that eclipse by default will use your system jre to start eclipse. You probably have seen a message when starting eclipse similar to "Eclipse is running under a JRE and m2eclipse requires a JDK some plugins will not work"

                如果您转到(在 Eclipse 中)帮助 -> 安装详细信息并查找 -vm,您可能会看到它指向的地方没有预期的路径结构.

                If you go to (in eclipse) Help -> Installation Details and look for a -vm you will probably see it pointing to somewhere that does not have the path structure that it is expecting.

                注意:无论出于何种原因,当我遇到这个问题时,maven 中的 java.home 是从 eclipse 的启动位置进行评估的.因此,当它尝试从它所看到的 java.home 中提取 tools.jar 时,它可能不是您实际设置为 JAVA_HOME 作为环境/系统变量的内容.

                Note: For whatever reason when I encountered this issue java.home in maven was evaluated from where eclipse was launched from. So when it tries to pull the tools.jar from what it sees as java.home it may not be what you actually set as JAVA_HOME as an env/system variable.

                这篇关于Maven 3 工件问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Java Bytecode Manipulation Library Suggestions(Java 字节码操作库建议)
                Java CLI UI-design: frameworks or libraries?(Java CLI UI 设计:框架还是库?)
                About the use of Beans.xml configuration file in Spring Framework application(关于Spring Framework应用中Beans.xml配置文件的使用)
                What is the difference between Spring, Struts, Hibernate, JavaServer Faces, Tapestry?(Spring、Struts、Hibernate、JavaServer Faces、Tapestry 有什么区别?)
                Are there any android application framework like spring?(有没有像spring这样的android应用程序框架?)
                Java Swing based game framework. Any advice?(基于 Java Swing 的游戏框架.有什么建议吗?)

                  <bdo id='MVtb2'></bdo><ul id='MVtb2'></ul>
                  <tfoot id='MVtb2'></tfoot>
                • <i id='MVtb2'><tr id='MVtb2'><dt id='MVtb2'><q id='MVtb2'><span id='MVtb2'><b id='MVtb2'><form id='MVtb2'><ins id='MVtb2'></ins><ul id='MVtb2'></ul><sub id='MVtb2'></sub></form><legend id='MVtb2'></legend><bdo id='MVtb2'><pre id='MVtb2'><center id='MVtb2'></center></pre></bdo></b><th id='MVtb2'></th></span></q></dt></tr></i><div id='MVtb2'><tfoot id='MVtb2'></tfoot><dl id='MVtb2'><fieldset id='MVtb2'></fieldset></dl></div>
                    <tbody id='MVtb2'></tbody>
                  <legend id='MVtb2'><style id='MVtb2'><dir id='MVtb2'><q id='MVtb2'></q></dir></style></legend>

                  <small id='MVtb2'></small><noframes id='MVtb2'>