0

我构建了一个名为ThreadPool-Maven的多模块项目

ThreadPool-Maven 包含两个项目ThreadPool-ImplementationThreadPool-Evaluator

两者是相互依赖的,ThreadPool-Evaluator 项目依赖于 ThreadPool-Implementation 项目。

ThreadPool-Implementation包含三个 java 文件。

  1. 线程池.java
  2. WorkerThreadPool.java
  3. 完成.java

ThreadPool-Evaluator包含两个 java 文件。

  1. 测试线程池.java
  2. TestWorkerThread.java

这些是我到现在为止的工作。现在我想构建一个ThreadPool-ImplementationThreadPool-Evaluator包, ThreadPool-Maven使用这些包来执行相同的任务。帮助我做到这一点。

POMS如下:-

线程池-Maven:-

<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.xyz.intern.multiple_project</groupId>
    <version>0.8-SNAPSHOT</version>
    <artifactId>ThreadPool-Maven</artifactId>
    <packaging>pom</packaging>
    <name>Simple Parent Project ThreadPool-Maven</name>

    <modules>
        <module>ThreadPool-Implementation</module>
        <module>ThreadPool-Evaluator</module>
    </modules>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>

ThreadPool-实现

<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>

   <parent>
    <groupId>com.xyz.intern.multiple_project</groupId>
    <artifactId>ThreadPool-Maven</artifactId>
    <version>0.8-SNAPSHOT</version>
  </parent>

  <artifactId>ThreadPool-Implementation</artifactId>
  <packaging>jar</packaging>

  <name>ThreadPool-Implementation </name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

</project>

ThreadPool-Evaluator

<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>
  <parent>
    <groupId>com.xyz.intern.multiple_project</groupId>
    <artifactId>ThreadPool-Maven</artifactId>
    <version>0.8-SNAPSHOT</version>
  </parent>
  <artifactId>ThreadPool-Evaluator</artifactId>
  <packaging>jar</packaging>

  <name>ThreadPool-Evaluation</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
        <groupId>com.xyz.intern.multiple_project</groupId>
        <artifactId>ThreadPool-Implementation</artifactId>
        <version>${project.version}</version>
    </dependency>
  </dependencies>

</project>
4

1 回答 1

0

Maven bundle 插件用于生成 OSGi 兼容的 bundle JAR 文件。查看Apache Felix Maven Bundle Plugin了解更多信息。

于 2013-01-29T18:43:59.923 回答