Tag: maven

Maven没有认识到在bash_profile中设置了JAVA_HOME

持续将近2天,试图让maven正确安装。 这些是我的输出。 为什么在世界上maven默认为某些jdk我甚至没有? 我已经尝试了从goole搜索提出的一百万种不同的解决方案,没有! 帮帮我。 我没有对任何配置文件(如mvn.sh进行任何更改。 System: Mac OS=Yosemite 10.10 Java=Oracle 1.8 JDK .bash_profile的内容: export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home export M2_HOME=/usr/local/Cellar/maven/3.2.3 export M2=$M2_HOME/bin export PATH=$PATH:$M2_HOME/bin 终端命令: java -version -> java version “1.8.0_25” Java(TM) SE Runtime Environment (build 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) mvn -version -> Error: JAVA_HOME is not defined correctly. We cannot […]

mvn + jetty出错:无法执行目标org.eclipse.jetty:jetty-maven-plugin:

当我尝试运行mvn jetty时,我遇到了一个奇怪的错误:在我的项目上运行。 当我在另一个系统上运行我的代码时,一切正常,但在我的Mac上,我得到了这个奇怪的错误。 它以前工作过,但突然间它不起作用。 这是错误消息: [ERROR] Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.1.0.M0:run (default-cli) on project assignment2-gui: Execution default-cli of goal org.eclipse.jetty:jetty-maven-plugin:9.1.0.M0:run failed: Unable to load the mojo ‘run’ in the plugin ‘org.eclipse.jetty:jetty-maven-plugin:9.1.0.M0’ due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/eclipse/jetty/maven/plugin/JettyRunMojo : Unsupported major.minor version 51.0 [ERROR] —————————————————– [ERROR] realm = plugin>org.eclipse.jetty:jetty-maven-plugin:9.1.0.M0 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy [ERROR] urls[0] […]

如果我想使用Maven,是否需要安装ADT插件?

如果我想使用maven构建所有项目,是否有必要将ADT插件下载并安装到Eclipse中?

NoClassDef-s再次使用Eclipse Jetty的Maven插件

拜托,有人帮助我,我很绝望。 我整晚都在努力。 我遇到的问题是: 使用Eclipse Jetty的Maven插件,奇怪的NoClassDef-s 基本上:我不能让Jetty插件的最新版本在集成测试中正常工作。 事实上,一切正常,直到Jetty的关闭阶段,当我被告知缺少org.eclipse.jetty.util.FutureCallback时。 我已经在上面的链接中包含了依赖项。 最初他们被忽略了,然后我在项目/构建/扩展中添加了它们。 现在我还有其他几个ClassNotFoundExceptions,我无法解决这个问题。 这就是我在POM中所拥有的: org.eclipse.jetty jetty-maven-plugin uk.ac.ebi.fg.myequivalents.test_flag true 10 true 10973 10974 KILL start-jetty pre-integration-test run 0 true stop-jetty post-integration-test stop 这些是我设置的扩展: org.eclipse.jetty jetty-util ${jetty.version} org.eclipse.jetty jetty-jsp ${jetty.version} org.eclipse.jetty jetty-io ${jetty.version} org.eclipse.jetty jetty-jaspi ${jetty.version} $ {jetty.version}在父和= 9.1.3.v20140225中定义,但我尝试了很多,低至7.x 此外,Maven是3.2.1,Java是1.7.0_51,在OS X 10.9.2上运行 提前感谢您对这个令人讨厌的问题的任何帮助。

XJC – 编译器无法遵守此类自定义

我想从我的Java项目调用ISAN Restful API,所以我试图使用maven-jaxb2-plugin从xsd文件生成java bean。 这是xsds: http://www.isan.org/schema/v1.11/common/common.xsd http://www.isan.org/schema/v1.21/common/serial.xsd http://www.isan.org/schema/v1.11/common/version.xsd http://www.isan.org/ISAN/isan.xsd http://www.isan.org/schema/v1.11/common/title.xsd http://www.isan.org/schema/v1.11/common/externalid.xsd http://www.isan.org/schema/v1.11/common/participant.xsd http://www.isan.org/schema/v1.11/common/language.xsd http://www.isan.org/schema/v1.11/common/country.xsd 我下载了这些文件并将它们复制到我的src / main / resources文件夹中并定义了一个目录。 当我构建项目时,我收到一个错误,因为两个类型具有相同的名称: org.xml.sax.SAXParseExceptionpublicId: http://www.isan.org/schema/v1.11/common/language; systemId: http://www.isan.org/schema/v1.11/common/language.xsd; lineNumber: 39; columnNumber: 48; A class/interface with the same name “org.isan.CodingSystemType” is already in use. Use a class customization to resolve this conflict. org.xml.sax.SAXParseExceptionpublicId: http://www.isan.org/schema/v1.11/common/country; systemId: http://www.isan.org/schema/v1.11/common/country.xsd; lineNumber: 39; columnNumber: 48; […]

无知我在设置Spring Boot REST应用程序时遇到了什么问题

在设置我认为是一个简单的Spring Boot Rest api的时候,我一直很困惑我做错了什么。 我确实有建立非常基本的春季应用程序(仍然是学生)的经验,但这是我第一次设置一个Spring Rest应用程序。 我确实在基本文件夹中有应用程序,应用程序似乎启动但是当我转到“localhost:8080 /”时出现404错误。 我假设也许我的pom不正确。 我注意到我的打印跟踪没有显示正在暴露的存储库。 谢谢你的帮助。 主要: @SpringBootApplication public class App { public static void main(String[] args) { SpringApplication.run(App.class, args); } } BaseEntity: @MappedSuperclass public abstract class BaseEntity { @Id @GeneratedValue(strategy = GenerationType.AUTO) private final Long id; protected BaseEntity() { id = null; } } 实体: @Entity public class Course […]

Maven原型文件名模式与下划线

我正在创建一个Maven原型。 我想生成像project_todo_messages.properties这样的文件,其中todo被过滤后的属性取代。 我在archetype-metadata.xml和archetype.properties创建了一个文件project___todo___messages.properties和一个过滤后的属性todo 。 重命名没有下划线的文件,但不包括过滤属性周围带下划线的文件。 有任何想法吗? 我使用maven-archetype-plugin 2.3和org.apache.maven.archetype:archetype-packaging 2.3。 其他问题:是否可以在文件名${todo.toLowerCase()}过滤值,就像在${todo.toLowerCase()}的文件内容中一样?

Maven从不同存储库的一个插件下载文件

我有奇怪的问题。 我有自己的远程存储库并上传他们的插件。 然后我尝试在打包项目时下载它。 Maven开始从own_remote_repo下载,但下载1个文件开始在repo1.maven.org/maven2上搜索另一个文件,当然找不到插件并失败。 我以前多次使用这个回购没有问题。 [编辑] 输出: Downloading: http://repo1.maven.org/maven2/com/my/maven/plugin/maven-plugin/1.1.3/maven-plugin-1.1.3.pom [INFO] Unable to find resource ‘com.my.maven.plugin:maven-plugin:pom:1.1.3’ in repository central (http://repo1.maven.org/maven2) Downloading: http://:/nexus/content/groups/public/com/my/maven/plugin/maven-plugin/1.1.3/maven-plugin-1.1.3.pom 3K downloaded (maven-plugin-1.1.3.pom) Downloading: http://repo1.maven.org/maven2/com/my/maven/plugin/maven-plugin/1.1.3/maven-plugin-1.1.3.jar [INFO] Unable to find resource ‘com.my.maven.plugin:maven-plugin:maven-plugin:1.1.3’ in repository central (http://repo1.maven.org/maven2) [INFO] ———————————————————————— [ERROR] BUILD FAILURE [INFO] ———————————————————————— [INFO] A required plugin was not found: Plugin could not be found […]

跨所有文件更新Javadoc版本和作者?

我需要在我的项目中保持所有类Javadoc的@version标记以及@author标记。 但是我不知道这么做的简单方法。 是否有可以实现此目的的插件(最好是maven插件)? 不,maven-release插件不会为我做这个。

YUI Compressor Maven插件在错误的时间执行,而tomcat插件不使用yui-compressor输出

我正在尝试使用YUI Compressor插件为maven压缩我的CSS和JavaScript,但我遇到了两个问题。 我的配置正确压缩和聚合JavaScript文件,但是如果我运行mvn package来生成war文件,maven会在它复制到src/main/webapp文件夹之前压缩JavaScript文件。 这会覆盖所有压缩的css和JavaScript文件。 我怎样才能解决这个问题? 如何让tomcat maven插件使用压缩的JavaScript文件而不是我的src/main/webapp/scripts文件夹中的文件? 当我的应用程序试图读取all.js ,它失败了,因为它位于target/目录而不是我的src/main/webapps文件夹中。 org.codehaus.mojo tomcat-maven-plugin 1.1 target/myapp-1.0.war net.alchim31.maven yuicompressor-maven-plugin compress **/jwplayer.js **/audio-player-noswfobject.js **/audio-player-uncompressed.js **/audio-player.js **/jscharts.js **/jquery-ui-1.8.16.custom.min.js true false false false true ${project.build.directory}/${project.build.finalName}/scripts/all.js **/json/json2.js **/jwplayer/jwplayer.js **/font/font.js **/underscore/underscore.js **/jquery/jquery-1.7.1.js **/jquery/jquery-ui-1.8.16.custom.min.js **/jquery/jquery.cookie.js **/jquery/jquery.fancybox.js **/jquery/jquery.highlight.js **/jquery/jquery.jcrop.js **/jquery/jquery.tmpl.js **/jquery/farbtastic.js **/jscharts/jscharts.js **/myapp/homepage.js 或者我只是以错误的方式实现我的目标? 这是包装战争时的maven输出。 你可以看到,即使我告诉yui:compress目标在预包装阶段,它仍然发生在复制资源之前,因为这发生在package阶段: [INFO] ———————————————————————— [INFO] Building My App 1.0 [INFO] ———————————————————————— […]