Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven插件-profileManager实例_Maven_Maven Plugin - Fatal编程技术网

Maven插件-profileManager实例

Maven插件-profileManager实例,maven,maven-plugin,Maven,Maven Plugin,如何在mojo中获取ProfileManager实例? 我正在尝试使用DefaultMavenProjectBuilder创建一个MavenProject。遵循以下两个步骤 1)通过注入检索MavenSession /** * The Maven Session * * @required * @readonly * @parameter * expression="${session}" */ private MavenSession session; 2)使用会话获取容器和执

如何在mojo中获取ProfileManager实例? 我正在尝试使用DefaultMavenProjectBuilder创建一个MavenProject。

遵循以下两个步骤

1)通过注入检索MavenSession

/**
 * The Maven Session
 *
 * @required
 * @readonly
 * @parameter
 * expression="${session}"
 */
private MavenSession session;
2)使用会话获取容器和执行属性,并创建新的ProfileManager

 PlexusContainer container = session.getContainer();  
 Properties execution = session.getExecutionProperties();
 ProfileManager manager = new DefaultProfileManager(container, execution);