[INFO] --- apache-rat-plugin:0.11:check (rat-check) @ apache-maven ---
[INFO] 51 implicit excludes (use -debug for more details).
[INFO] Exclude: src/test/resources*/**
[INFO] Exclude: src/test/projects/**
[INFO] Exclude: src/test/remote-repo/**
[INFO] Exclude: **/*.odg
[INFO] Exclude: src/bin/m2.conf
[INFO] Exclude: bootstrap/**
[INFO] Exclude: README.bootstrap.txt
[INFO] Exclude: .repository/**
[INFO] Exclude: .maven/spy.log
[INFO] Exclude: .java-version
[INFO] Exclude: README.md
[INFO] Exclude: DEPENDENCIES
[INFO] 19 resources included (use -debug for more details)
[INFO] Rat check: Summary of files. Unapproved: 0 unknown: 0 generated: 0 approved: 16 licence.
[INFO]
[INFO] --- maven-dependency-plugin:2.8:unpack-dependencies (unpack-jansi-native) @ apache-maven ---
[INFO] Unpacking /root/.m2/repository/org/fusesource/jansi/jansi/1.16/jansi-1.16.jar to /tmp/maven-build/apache-maven/target/dependency with includes "META-INF/native/**" and excludes ""
[INFO]
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ apache-maven ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Maven ...................................... SUCCESS [25.091s]
[INFO] Maven Model ....................................... SUCCESS [18.000s]
[INFO] Maven Artifact .................................... SUCCESS [4.418s]
[INFO] Maven Plugin API .................................. SUCCESS [4.677s]
[INFO] Maven Builder Support ............................. SUCCESS [1.900s]
[INFO] Maven Model Builder ............................... SUCCESS [5.690s]
[INFO] Maven Settings .................................... SUCCESS [1.905s]
[INFO] Maven Settings Builder ............................ SUCCESS [2.010s]
[INFO] Maven Repository Metadata Model ................... SUCCESS [1.511s]
[INFO] Maven Artifact Resolver Provider .................. SUCCESS [5.110s]
[INFO] Maven Core ........................................ SUCCESS [13.168s]
[INFO] Maven SLF4J Simple Provider ....................... SUCCESS [5.013s]
[INFO] Maven Embedder .................................... SUCCESS [3.617s]
[INFO] Maven Compat ...................................... SUCCESS [4.462s]
[INFO] Apache Maven Distribution ......................... FAILURE [4:18.467s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5:58.134s
[INFO] Finished at: Mon Feb 12 21:03:11 GMT 2018
[INFO] Final Memory: 83M/190M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-remote-resources-plugin:1.5:process (default) on project apache-maven: Error rendering velocity resource. Invocation of method 'getResourceAsFile' in class org.codehaus.plexus.resource.DefaultResourceManager threw exception org.codehaus.plexus.resource.loader.ResourceNotFoundException: Could not find resource 'https://www.apache.org/licenses/LICENSE-2.0.txt'. at remote-resources[line 38, column 26] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :apache-maven
是否有一种方法可以禁用远程资源检索(也许有利于本地资源),最好是通过向Maven传递命令行参数,但如果不能,则通过修改Maven根POM的本地副本?
编辑:添加完整堆栈跟踪。似乎GetResourceAsfile
方法是使用来自Velocity的反射调用的,这使我认为一定有一个Velocity模板在某个Apache工件中引用GetResourceAsfile
,但是我在https://svn.Apache.org/repos/asf/maven/resources/的repo中找不到任何内容
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-remote-resources-plugin:1.5:process (default) on project apache-maven: Error rendering velocity resource. Invocation of method 'getResourceAsFile' in class org.codehaus.plexus.resource.DefaultResourceManager threw exception org.codehaus.plexus.resource.loader.ResourceNotFoundException: Could not find resource 'https://www.apache.org/licenses/LICENSE-2.0.txt'. at remote-resources[line 38, column 26] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-remote-resources-plugin:1.5:process (default) on project apache-maven: Error rendering velocity resource.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error rendering velocity resource.
at org.apache.maven.plugin.resources.remote.ProcessRemoteResourcesMojo.processResourceBundles(ProcessRemoteResourcesMojo.java:1246)
at org.apache.maven.plugin.resources.remote.ProcessRemoteResourcesMojo.execute(ProcessRemoteResourcesMojo.java:520)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getResourceAsFile' in class org.codehaus.plexus.resource.DefaultResourceManager threw exception org.codehaus.plexus.resource.loader.ResourceNotFoundException: Could not find resource 'https://www.apache.org/licenses/LICENSE-2.0.txt'. at remote-resources[line 38, column 26]
at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:243)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:187)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567)
at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:420)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:420)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.apache.velocity.runtime.RuntimeInstance.render(RuntimeInstance.java:1378)
at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1314)
at org.apache.velocity.app.Velocity.evaluate(Velocity.java:254)
at org.apache.maven.plugin.resources.remote.ProcessRemoteResourcesMojo.processResourceBundles(ProcessRemoteResourcesMojo.java:1218)
... 22 more
Caused by: org.codehaus.plexus.resource.loader.ResourceNotFoundException: Could not find resource 'https://www.apache.org/licenses/LICENSE-2.0.txt'.
at org.codehaus.plexus.resource.DefaultResourceManager.getResource(DefaultResourceManager.java:173)
at org.codehaus.plexus.resource.DefaultResourceManager.getResourceAsFile(DefaultResourceManager.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
... 41 more
编辑2:我想我找到了罪魁祸首:https://github.com/apache/maven/blob/maven-3.5.2/apache-maven/src/main/append-resources/meta-inf/license.vm
它使用GetResourceAsFile
和许可证URL。
但我不知道这是从远程资源插件中提取的。
我不熟悉Apache Velocity。有人能帮助如何覆盖它吗?
注意:不是问题33548395的重复,因为该问题是关于相关性解析的,但这是关于远程资源的,这是不同的。正在下载的文件不是Maven依赖项,它只是一个文本文件。我希望它使用的相应的Maven依赖项是apache-jar-resource-bundle
,但是该依赖项已经存在于我可以访问的远程存储库中,所以我不需要强制Maven在本地读取它。但是,它似乎尝试直接下载文件,而不是通过Maven依赖项下载。
在意识到license.vm(以及apache-maven中的那个,而不是另一个)是问题所在之后(参见我的“编辑2”),我发现它也包含了解决方案。Glassfish的URL被手动重定向到另一个URL中,它位于文件的第32-35行。所以我想我可以为我的场景做一些类似的事情。
首先,我制定了所有的许可证,并下载了它们。我为它们提供了.license
扩展名,这样我就可以告诉Git将具有此扩展名的文件视为二进制文件(通过.gitattributes
),这样它就不会试图通过转换行尾来扰乱文件,因为我希望复制实际构建所做的事情。实际上我总共只需要下载5个文件。
其次,我创建了一个小片段插入到VM文件中;我将其称为license-redirect-snippet.vm
:
## redirect all license URLs to local files
#if ($url == "https://www.apache.org/licenses/LICENSE-2.0.txt")
#set ( $url = '/usr/local/share/maven-build-licenses/apache2-txt.license' )
#end
#if ($url == "http://www.apache.org/licenses/LICENSE-2.0.txt")
#set ( $url = '/usr/local/share/maven-build-licenses/apache2-txt.license' )
#end
#if ($url == "http://www.apache.org/licenses/LICENSE-2.0")
#set ( $url = '/usr/local/share/maven-build-licenses/apache2-html.license' )
#end
#if ($url == "https://glassfish.java.net/public/CDDLv1.0.html")
#set ( $url = '/usr/local/share/maven-build-licenses/cddl1-html.license' )
#end
#if ($url == "http://www.eclipse.org/legal/epl-v10.html")
#set ( $url = '/usr/local/share/maven-build-licenses/epl1-html.license' )
#end
#if ($url == "http://www.opensource.org/licenses/mit-license.php")
#set ( $url = '/usr/local/share/maven-build-licenses/mit-html.license' )
#end
sed -i '35r /tmp/license-redirect-snippet.vm' /tmp/maven-build/apache-maven/src/main/appended-resources/META-INF/LICENSE.vm
问题内容: 我正在使用简单的maven安装使用maven来构建jar。如果我添加了文件,则可以在类路径上找到它,但是它有一个config文件夹,我希望该文件进入该文件夹,但是将其移动到config文件夹中会使它从类路径中消失。 问题答案: 如果您将任何内容放置在目录中,那么默认情况下它将以final结尾。如果您是从其他项目引用它的,但是在类路径中找不到它,那么您犯了以下两个错误之一: 未正确加载(
问题内容: 我正在尝试针对Chrome运行Selenium测试。当我在本地初始化驱动程序时: 一切正常(我已经将Chrome二进制文件放在PATH上),但是当我尝试远程启动它时: 我收到以下错误 Selenium :: WebDriver :: Error :: UnhandledError:chromedriver可执行文件的路径必须由webdriver.chrome.driver系统属性设置;
我在一个项目中使用了,该项目是用文件作为影子JAR构建的(即,这些文件包含在JAR中,而不仅仅是一个依赖项。 问题是,2.10.0现在已经存在已知的安全问题,但没有更新版本的spring库带有补丁的jackson文件。所以,我需要做的是使用现有的spring图书馆,但更新的jackson图书馆。如果它是一个正常的依赖关系,这将是足够容易的,但显然文件不能从spring库中删除。 因此,有什么方法可
我创建了一个Spring Boot far-jar,其中包含一个log4j.xml配置文件作为资源。现在,当我运行fat-jar时,我试图以这种方式覆盖它 我在文件夹中放入了一个新的log4j.xml。但是什么都没有,它继续使用JAR中的资源。
我正在尝试使用maven-telte-resource-plugin在多模块maven项目中跨模块共享许多资源。不幸的是,共享的二进制资源在捆绑期间被损坏,大概是通过过滤。 我相信,由于从本地存储库中提取共享资源jar时包含损坏的二进制文件,因此在这一阶段会发生损坏。 是否有任何关闭过滤maven-远程资源插件? 目前,我的共享资源模块中的pom看起来像
我是服务器端web开发的新手,最近我读了很多关于实现RESTful API的文章。REST API的一个方面我仍然坚持是如何构建URI层次结构,该层次结构标识客户机可以与之交互的资源。具体地说,我一直在决定在资源由其他资源类型组成的情况下,层次结构有多详细,以及该做些什么。 这里有一个例子,希望能说明我的意思。假设我们有一个web服务,它允许用户从其他用户那里购买产品。所以在这个简单的例子中,有两