我试图移动到maven作为构建系统,以便对依赖关系进行更标准的管理。
以下是我做的步骤和我问的简单问题。这个过程是我能想到的最简单的,所以这个问题应该很容易重现。
Failed to execute goal on project CreatingMavenSpringProject: Could not resolve dependencies for project com.mycompany:CreatingMavenSpringProject:war:1.0-SNAPSHOT: The following artifacts could not be resolved: javax.sql:jdbc-stdext:jar:2.0, javax.transaction:jta:jar:1.0.1B: Could not find artifact javax.sql:jdbc-stdext:jar:2.0 in unknown-jars-temp-repo (file:C:\Users\agostino\Documents\NetBeansProjects\CreatingMavenSpringProject/lib) -> [Help 1] To see the full stack trace of the errors, re-run Maven with the -e switch. Re-run Maven using the -X switch to enable full debug logging.
我已经试过了:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o n project CreatingMavenSpringProject: Could not resolve dependencies for project com.mycompany:CreatingMavenSpringProject:war:1.0-SNAPSHOT: The following artifa cts could not be resolved: javax.sql:jdbc-stdext:jar:2.0, javax.transaction:jta: jar:1.0.1B: Failure to find javax.sql:jdbc-stdext:jar:2.0 in file:C:\Users\agost ino\Documents\NetBeansProjects\CreatingMavenSpringProject/lib was cached in the local repository, resolution will not be reattempted until the update interval o f unknown-jars-temp-repo has elapsed or updates are forced at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe pendencies(LifecycleDependencyResolver.java:210) at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resol veProjectDependencies(LifecycleDependencyResolver.java:117) at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAr eResolved(MojoExecutor.java:258) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor .java:201) 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.buildProje ct(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje ct(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu ild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl eStarter.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:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun cher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav a:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La uncher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java: 352) Caused by: org.apache.maven.project.DependencyResolutionException: Could not res olve dependencies for project com.mycompany:CreatingMavenSpringProject:war:1.0-S NAPSHOT: The following artifacts could not be resolved: javax.sql:jdbc-stdext:ja r:2.0, javax.transaction:jta:jar:1.0.1B: Failure to find javax.sql:jdbc-stdext:j ar:2.0 in file:C:\Users\agostino\Documents\NetBeansProjects\CreatingMavenSpringP roject/lib was cached in the local repository, resolution will not be reattempte d until the update interval of unknown-jars-temp-repo has elapsed or updates are forced at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(D efaultProjectDependenciesResolver.java:189) at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe pendencies(LifecycleDependencyResolver.java:185) ... 22 more Caused by: org.sonatype.aether.resolution.DependencyResolutionException: The fol lowing artifacts could not be resolved: javax.sql:jdbc-stdext:jar:2.0, javax.tra nsaction:jta:jar:1.0.1B: Failure to find javax.sql:jdbc-stdext:jar:2.0 in file:C :\Users\agostino\Documents\NetBeansProjects\CreatingMavenSpringProject/lib was c ached in the local repository, resolution will not be reattempted until the upda te interval of unknown-jars-temp-repo has elapsed or updates are forced at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDepe ndencies(DefaultRepositorySystem.java:375) at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(D efaultProjectDependenciesResolver.java:183) ... 23 more Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: The follo wing artifacts could not be resolved: javax.sql:jdbc-stdext:jar:2.0, javax.trans action:jta:jar:1.0.1B: Failure to find javax.sql:jdbc-stdext:jar:2.0 in file:C:\ Users\agostino\Documents\NetBeansProjects\CreatingMavenSpringProject/lib was cac hed in the local repository, resolution will not be reattempted until the update interval of unknown-jars-temp-repo has elapsed or updates are forced at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def aultArtifactResolver.java:538) at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti facts(DefaultArtifactResolver.java:216) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDepe ndencies(DefaultRepositorySystem.java:358) ... 24 more Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to fi nd javax.sql:jdbc-stdext:jar:2.0 in file:C:\Users\agostino\Documents\NetBeansPro jects\CreatingMavenSpringProject/lib was cached in the local repository, resolut ion will not be reattempted until the update interval of unknown-jars-temp-repo has elapsed or updates are forced at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.newExcept ion(DefaultUpdateCheckManager.java:230) at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArti fact(DefaultUpdateCheckManager.java:204) at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def aultArtifactResolver.java:427) ... 26 more
现在我被困在这一点上,请注意,这是maven项目在尝试添加hibernate时的开箱即用行为。如何解决这个问题?
您总是可以手动下载依赖项。例如,您可以从http://download.java.net/maven/2/javax/sql/jdbc-stdext/2.0/jdbc-stdext-2.0.jar下载-jdbc-stdext-2.0.jar-从http://download.java.net/maven/2/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar下载-jta-1.0.1B. jar
然后把罐子放在正确的位置。m2仓库。-。m2/repository/javax/sql/jdbc-stdext/2.0/jdbc-stdext-2.0。罐子-。m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B。罐子
然后运行maven clean和build。
您可以通过在存储库部分下添加以下存储库来手动修改POM文件:
<repositories>
...
<repository>
<id>java.net-m2</id>
<name>java.net - Maven 2</name>
<url>https://repository.jboss.org/nexus/content/repositories/java.net-m2</url>
</repository>
</repositories>
使用Tomcat 7.0.27,我看不到第一个问题(Spring依赖项),但我可以复制第二个问题(无法下载depdencies)。检查pom。xml
我发现它有如下错误:
xml prettyprint-override"><dependency>
<groupId>unknown.binary</groupId>
<artifactId>derbyclient</artifactId>
<version>SNAPSHOT</version>
</dependency>
和此存储库:
<repository>
<id>unknown-jars-temp-repo</id>
<name>A temporary repository created by NetBeans for libraries and jars it
could not identify. Please replace the dependencies in this repository with
correct ones and delete this repository.</name>
<url>file:${project.basedir}/lib</url>
</repository>
尽管Netbeans wiki页面展示了Maven项目的框架选择示例,但我还是建议从“添加依赖项…”中添加依赖项“依赖项”节点的选项。
编辑:在不同的机器中重复相同的步骤后添加了pom.xml
错误。
我已经开发了一个Web应用程序使用Spring启动。我有三个资源文件夹在src/main/资源分期,qa,生产,其中包括应用程序属性和日志配置的特定环境。随着这些文件夹,我有application.properties和日志配置在资源文件夹中,我用它来开发环境。我想使用spring-boot-maven插件根据环境打包war文件。我是maven新手,任何帮助都将不胜感激?
问题内容: 大家好。我正在制作一个词汇应用程序,需要在其中创建一个 (或ArrayList)。为此,我创建了以下代码(仅作为示例): 我还尝试了以下方法: 他们两个都将该项目添加到列表中,但是在调试时,我发现它的数组有12个对象,如下所示: 我的问题是我不能拥有这些空项目,因为此新列表是上的键,因此任何更改都将导致异常,因为该键将不存在。 使用调试器的列表(tempSOLUTION)详细信息的屏幕
问题内容: 我将此组合框添加到面板中。如果直接在数据库中添加一些项目,则希望那些新添加的项目显示在组合框中。 我可以在调试时看到这些值,但是这些值不会出现在我的组合框中。 如何在不关闭面板的情况下将那些新添加的值放入组合框? 问题答案: 如何使用ComboBoxModel?像这样…
6.3.启动Yamba项目 接下来开始编写Yamba。打开你的Eclipse,选择File→New→Android Project。 然后出现一个对话框(如图6.2 "New Project 对话框"),要求你输入有关新项目的各种信息。其中重要的条目如下: Project Name 这是Eclipse项目的名字。出于方便以后使用命令行的考虑,最好不要在项目名里夹带空格。输入Yamba。 Conte
Spring Boot是否可以在上下文中正确地加载旧的jar?旧jar中的pom文件是否不会受到影响,因为它引用了一些父级的spring版本以及使用相同版本的jar?或者这些JAR只使用spring boot添加的依赖关系? 有人能建议我哪里做错了吗?
我在我的项目中使用ActionBarSherlock,有时需要在操作栏中添加一个或多个项。 在这个BaixadosFragment类(扩展了SherlockFragment)中,我使用了以下代码,它运行良好: [编辑]根据Droidt的建议,这奏效了: