我是一个和maven一起工作的新手。
我已经使用maven插件编译了一个用于编译目标的应用程序。
当我执行:mvn compile
时,我看到了这一点。
[user@pc111 userAPP]$ mvn compile
make -C ./configure install
make[1]:Entering directory `directory path'
perl /filepath/file.pl O.linux-x86_64 ../..
mkdir O.Common
make -C O.linux-x86_64 -f ../Makefile TOP=../.. T_A=linux-x86_64 install
make[2]: Entering directory `directory path´
perl /filepath2/file2.pl
...
我的问题是:
maven call make在哪里?
因为查看了mvn二进制文件,它调用了java,编译后的mojo创建了一个扩展到AbstractMojo的对象。但在哪里叫做?我的项目有很多makefile。 正如我所说我是新手,所以如果有些信息令人困惑或需要其他信息,请告诉我。 谢谢你的帮助。 抱歉我的英语,但它不是我的母语。
编辑:这是我的pom.xml。
<!--
Project : My Project
Description : Project description file for App
Authors : This file was generated by
-->
<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>mygroupid</groupId>
<artifactId>TEST</artifactId>
<packaging>java</packaging>
<version>2.0.0</version>
<name>TEST module</name>
<description>TEST module</description>
<!-- project properties -->
<properties>
<unit.type>module</unit.type>
</properties>
<!-- parent pom.xml -->
<parent>
<groupId>org.mycompany</groupId>
<artifactId>maven-mycompany-settings</artifactId>
<version>2.2.0</version>
</parent>
<!-- unit owner and developers -->
<developers>
<developer>
<id>developer</id>
<roles>
<role>unit owner</role>
</roles>
</developer>
</developers>
<!-- configuration of how the project is built -->
<build>
<!-- default phase is compile -->
<defaultGoal>compile</defaultGoal>
<!-- this command is executed if you just write 'mvn' -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-mycompany-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<packaging>
<!--"some packaging config"-->
</packaging>
</configuration>
</plugin>
</plugins>
</build>
在pom.xml中查看负责执行make的mojo应该是compileMojo。但是我在哪里可以找到调用make的代码。因为在../mojos/build/CompileMojo.java中没有调用make。 executeMojo()方法可以负责调用make吗?
答案 0 :(得分:1)
Maven是一个框架来协调许多不同的插件来构建一些东西。
在您的情况下,其中一个插件正在调用make
。
由于Maven记录了它运行的插件,所以您需要做的就是再次启用日志输出。出于某种原因,您对mvn
的调用不会打印任何内容。你需要找出原因。在-q
或$MVN_OPTS
或~/.mavenrc
中查找命令行选项{{1}}。