- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在关注maven的教程。我有一个非常简单的项目,里面有几个模块。在模块 pom 上,我想通过 ${parent.groupid} 和 ${parent.version} 引用主项目 pom 版本和组,所以如果我更改其中任何一个,我就不必在子 pom 中搜索和更改它们,但我得到不可解析的父 POM:无法传输 Artifact 错误
我在 stackoverflow 上阅读了几个“不可解析的父 POM:”问题,但我读过的任何内容都没有帮助。
我的目录结构如下:
tutorial_maven(dir)
--> pom.xml(file)
--> tutorial_maven_jar(dir)
--> pom.xml(file)
Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: C:\Program Files (x86)\apache-maven-3.0.4
Java version: 1.7.0_09, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_09\jre
Default locale: es_EC, platform encoding: UTF-8
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from C:\Program Files (x86)\apache-maven-3.0.4\conf\settings.xml
[DEBUG] Reading user settings from C:\Users\fureta.DESARROLLO03\.m2\settings.xml
[WARNING] Command line option -npr is deprecated and will be removed in future Maven versions.
[DEBUG] Using local repository at C:\Users\fureta.DESARROLLO03\.m2\repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for C:\Users\fureta.DESARROLLO03\.m2\repository
[INFO] Scanning for projects...
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://repo.maven.apache.org/maven2
Downloading: http://repo.maven.apache.org/maven2/${parent/groupId}/tutorial_maven/${parent.version}/tutorial_maven-${parent.version}.pom
[DEBUG] Writing resolution tracking file C:\Users\fureta.DESARROLLO03\.m2\repository\${parent\groupId}\tutorial_maven\${parent.version}\tutorial_maven-${parent.version}.pom.lastUpdated
[DEBUG] Extension realms for project org.felipe:tutorial_maven:pom:1.0-SNAPSHOT: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[DEBUG] Extension realms for project org.felipe:tutorial_maven_webapp:war:1.0-SNAPSHOT: (none)
[DEBUG] Looking up lifecyle mappings for packaging war from ClassRealm[plexus.core, parent: null]
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[WARNING] 'parent.relativePath' points at org.felipe:tutorial_maven instead of ${parent.groupId}:tutorial_maven, please verify your project structure @ line 3, column 13
[FATAL] Non-resolvable parent POM: Could not transfer artifact ${parent.groupId}:tutorial_maven:pom:${parent.version} from/to central (http://repo.maven.apache.org/maven2): Illegal character in path at index 37: http://repo.maven.apache.org/maven2/${parent/groupId}/tutorial_maven/${parent.version}/tutorial_maven-${parent.version}.pom and 'parent.relativePath' points at wrong local POM @ line 3, column 13
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:363)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:585)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:234)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
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:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
[ERROR]
[ERROR] The project ${parent.groupId}:tutorial_maven_jar:${parent.version} (C:\Users\fureta.DESARROLLO03\IdeaProjects\tutorial_maven\tutorial_maven_jar\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not transfer artifact ${parent.groupId}:tutorial_maven:pom:${parent.version} from/to central (http://repo.maven.apache.org/maven2): Illegal character in path at index 37: http://repo.maven.apache.org/maven2/${parent/groupId}/tutorial_maven/${parent.version}/tuto rial_maven-${parent.version}.pom and 'parent.relativePath' points at wrong local POM @ line 3, column 13 -> [Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Could not transfer artifact ${parent.groupId}:tutorial_maven:pom:${parent.version} from/to central (http://repo.maven.apache.org/maven2): Illegal character in path at index 37: http://repo.maven.apache.org/maven2/${parent/groupId}/tutorial_maven/${parent.version}/tuto rial_maven-${parent.version}.pom
at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:159)
at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:813)
at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:664)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:310)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:232)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:410)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:379)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:495)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:379)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:343)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:585)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:234)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
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:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not transfer artifact ${parent.groupId}:tutorial_maven:pom:${parent.version} from/to central (http://repo.maven.apache.org/maven2): Illegal character in path at index 37: http://repo.maven.apache.org/maven2/${parent/groupId}/tutorial_maven/${parent.version}/tuto rial_maven-${parent.version}.pom
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:286)
at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:155)
... 30 more
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact ${parent.groupId}:tutorial_maven:pom:${parent.version} from/to central (http://repo.maven.apache.org/maven2): Illegal character in path at index 37: http://repo.maven.apache.org/maven2/${parent/groupId}/tutorial_maven/${parent.version}/tutorial_maven-${parent.version}.pom
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:951)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:941)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:669)
at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 37: http://repo.maven.apache.org/maven2/${parent/groupId}/tutorial_maven/${parent.version}/tutorial_maven-${parent.version}.pom
at java.net.URI.create(URI.java:859)
at org.apache.maven.wagon.providers.http.httpclient.client.methods.HttpGet.<init>(HttpGet.java:69)
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:778)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:601)
... 4 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 37: http://repo.maven.apache.org/maven2/${parent/groupId}/tutorial_maven/${parent.version}/tutorial_maven-${parent.version}.pom
at java.net.URI$Parser.fail(URI.java:2829)
at java.net.URI$Parser.checkChars(URI.java:3002)
at java.net.URI$Parser.parseHierarchical(URI.java:3086)
at java.net.URI$Parser.parse(URI.java:3034)
at java.net.URI.<init>(URI.java:595)
at java.net.URI.create(URI.java:857)
... 10 more
[ERROR]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.felipe</groupId>
<artifactId>tutorial_maven</artifactId>
<version>1.0-SNAPSHOT</version>
<modules>
<module>tutorial_maven_jar</module>
<module>tutorial_maven_webapp</module>
</modules>
<packaging>pom</packaging>
<name>tutorial_maven</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!--<log4j.version>1.2.17</log4j.version>-->
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
<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/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>tutorial_maven</artifactId>
<groupId>${parent.groupId}</groupId>
<version>${parent.version}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>tutorial_maven_jar</artifactId>
<packaging>jar</packaging>
<name>tutorial_maven_jar</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
<!--<optional>true</optional>-->
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
</project>
最佳答案
看起来您正在尝试从父级继承 groupId,并同时使用继承的 groupId 指定父级!
在子 pom 中,使用如下内容:
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.felipe</groupId>
<artifactId>tutorial_maven</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>tutorial_maven_jar</artifactId>
${project.groupId}
这样的属性不会在那里工作。如果这样指定parent,那么可以继承child pom中的groupId和version。因此,您只需要在子 pom.xml 中指定 artifactId。
关于maven - "Non-resolvable parent POM: Could not transfer artifact"尝试使用 ${parent.groupid} 从子 pom 引用父 pom,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13500332/
我正在使用 Maven 3.x,我的父 pom 和子 pom 中有以下结构。 父类 com.mygoogle.sample workorder 1.0-SNAPSHOT pom 1.0-SN
我已将各个项目中的所有存储库配置重构为一个父 pom,该父 pom 是为了对存储库和分发管理等内容进行单点配置的特定目的而创建的。据我了解,这应该是最佳实践。将我的父 pom 部署到 Nexus 服务
我尝试使用 mvn help:effective-pom 命令在示例应用程序上生成有效的 pom。 http://books.sonatype.com/mvnref-book/reference/po
在一个项目中,我们有一个名为时间戳的属性,它没有在父 POM 和子 POM 中定义,但仍然可以在 pom.xml 中访问。任何线索将不胜感激。 最佳答案 它可以由插件设置(如 https://www.
我在使用“uploadArchives”上传存档时收到“无法初始化 POM pom-default.xml:无法验证 POM”。我也尝试了 maven-publish 插件,但仍然没有成功。我们将不胜
我创建了一个程序,使用 HTML5 canvas 绘制一个 pom pom,参数大小、x、y、蓬松度和颜色。 pom pom 是通过从中心出来的画线创建的,参数蓬松度决定了从中心出来的股数。我有一个确
我正在关注maven的教程。我有一个非常简单的项目,里面有几个模块。在模块 pom 上,我想通过 ${parent.groupid} 和 ${parent.version} 引用主项目 pom 版本和
当我构建我的项目时,我收到以下警告: [INFO] ------------------------------------------------------------------------ [
我正在尝试构建一个 Maven 项目。我的其他团队成员能够毫无问题地构建它。我收到以下错误: [WARNING] The POM for org.hectorclient:hector-core:ja
我目前正在为 Maven 苦苦挣扎:我有一个由几个嵌套模块组成的复杂项目,对于其中一些模块,我在 POM 中有类似的配置。 我想让它干净。实际上,我想定义一个“runnable-jar”通用配置并在某
我正在将 maven Artifact 推送到 nexus,对于版本号小于子 POM 的父 POM 是否有任何影响? 最佳答案 据我所知没有。多模块项目中的模块版本可能以任何可能的方式有所不同。但是,
我在 Eclipse (Helios) 中有一个项目,带有 Maven pom.xml。我的项目是一个将使用 Hibernate、MySQL 的 Web 应用程序。 但是我在正确处理 pom.xml
repository我的 build.grade 部分已: mavenLocal() //maven { url { 'http://192.168.2
在多模块项目结构中 myApp |-moduleA |---pom.xml |-moduleB |---pom.xml |-pom.xml 如果我在 parent.pom 中有以下属性 4
我为 Maven 插件编写了代码,用于更新 pom 文件中的版本号。但是,当我尝试保存新的 pom 时,它被保存为有效的 pom。有没有办法将其保存为解析之前的样子?谢谢! private Maven
我有一个父 pom 在 pluginManagement 中定义了插件的一些配置项,其中有一个特定的配置。我不想在 child pom 中。 我尝试覆盖我的子 pom 中的其他配置项,这有效,但“删除
我不确定这是否受 Maven 支持。我很感激我能得到的任何帮助。 我有一个定义依赖项和排除项的父 pom。我无法更改父 pom: foo bar 1.0
当前场景: 父pom有一个distributionManagement部分,里面定义了两个repositories(releases和snapshots);引用如下: 父 pom:
似乎有几种方法可以在多项目构建中构建父 pom,我想知道是否有人对每种方式的优点/缺点有任何想法。 拥有父 pom 的最简单方法是将其放在项目的根目录中,即 myproject/ myprojec
我想在我的 Maven 项目中定义一个本地存储库。 我有一个 super pom 和几个子模块。我的文件结构是: /root /repository /child po
我是一名优秀的程序员,十分优秀!