如何在 Tycho 中构建子模块
How To Build Child Modules In Tycho
我有一个带有目标定义文件的多模块 Tycho 构建。目标定义在它自己的项目中定义(ID:org.acme.project.target
,打包类型:pom
)像这样:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>platform_rcp.target</file>
<type>target</type>
<classifier>platform_rcp</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Maven 父代是这样引用这个目标平台的:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<resolver>p2</resolver>
<target>
<artifact>
<groupId>${project.groupId}</groupId>
<artifactId>org.acme.project.target</artifactId>
<version>${project.version}</version>
<classifier>platform_rcp</classifier>
</artifact>
</target>
</configuration>
</plugin>
只要我构建父项目,此设置就有效。当我构建子模块之一时,即使该项目复制了对目标平台的引用,或者即使我使用 mvn install -pl org.acme.project
构建父模块,我也会收到以下异常:
[ERROR] Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact myGroup:org.acme.project.target:target:platform_rcp:2.3.0-SNAPSHOT -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact myGroup:org.acme.project.target:target:platform_rcp:2.3.0-SNAPSHOT
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:121)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
即使 the Tycho example 对我也不起作用,但会带来相同的错误消息 (Could not resolve target platform specification artifact example.group:mars:target:1.0.0-SNAPSHOT
)。
我认为 this question 类似,但我的设置正是答案中所说的。
我做错了什么?
(实际问题是,所以我只能用Tycho来运行他们,Tycho构建所有模块需要很长时间。)
even when I build the parent with mvn install -pl org.acme.project I get the following exception:
您是否尝试过将目标平台项目添加到 -pl
个参数列表中:mvn install -pl :mars,org.acme.project
我一直用这个。
我有一个带有目标定义文件的多模块 Tycho 构建。目标定义在它自己的项目中定义(ID:org.acme.project.target
,打包类型:pom
)像这样:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>platform_rcp.target</file>
<type>target</type>
<classifier>platform_rcp</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Maven 父代是这样引用这个目标平台的:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<resolver>p2</resolver>
<target>
<artifact>
<groupId>${project.groupId}</groupId>
<artifactId>org.acme.project.target</artifactId>
<version>${project.version}</version>
<classifier>platform_rcp</classifier>
</artifact>
</target>
</configuration>
</plugin>
只要我构建父项目,此设置就有效。当我构建子模块之一时,即使该项目复制了对目标平台的引用,或者即使我使用 mvn install -pl org.acme.project
构建父模块,我也会收到以下异常:
[ERROR] Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact myGroup:org.acme.project.target:target:platform_rcp:2.3.0-SNAPSHOT -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact myGroup:org.acme.project.target:target:platform_rcp:2.3.0-SNAPSHOT
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:121)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
即使 the Tycho example 对我也不起作用,但会带来相同的错误消息 (Could not resolve target platform specification artifact example.group:mars:target:1.0.0-SNAPSHOT
)。
我认为 this question 类似,但我的设置正是答案中所说的。
我做错了什么?
(实际问题是
even when I build the parent with mvn install -pl org.acme.project I get the following exception:
您是否尝试过将目标平台项目添加到 -pl
个参数列表中:mvn install -pl :mars,org.acme.project
我一直用这个。