當前位置: 首頁>>代碼示例>>Java>>正文


Java Parent.setRelativePath方法代碼示例

本文整理匯總了Java中org.apache.maven.model.Parent.setRelativePath方法的典型用法代碼示例。如果您正苦於以下問題:Java Parent.setRelativePath方法的具體用法?Java Parent.setRelativePath怎麽用?Java Parent.setRelativePath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.maven.model.Parent的用法示例。


在下文中一共展示了Parent.setRelativePath方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fixParentProject

import org.apache.maven.model.Parent; //導入方法依賴的package包/類
private void fixParentProject(IProject p, IProject parentProject)
		throws CoreException {
	IFile existingPom = p.getFile("pom.xml");
	Model model = MavenPlugin.getMavenModelManager().readMavenModel(existingPom);
	Model parent = MavenPlugin.getMavenModelManager().readMavenModel(parentProject.getFile("pom.xml"));
	//Parent oldParent = model.getParent();
	Parent newParent = new Parent();
	newParent.setGroupId(parent.getGroupId());
	newParent.setArtifactId(parent.getArtifactId());
	newParent.setRelativePath(calculateRelativePath(p, parentProject));
	newParent.setVersion(parent.getVersion());
	model.setParent(newParent);
	// outright deletion doesn't work on windows as the process has a ref to the file itself
	// so creating a temp '_newpom_.xml'
	final IFile newPom = p.getFile("_newpom_.xml");
	MavenPlugin.getMavenModelManager().createMavenModel(newPom, model);
	// then copying that content over to the pom.xml
	existingPom.setContents(newPom.getContents(), true,  true, new NullProgressMonitor());
	// and deleting the temp pom
	newPom.delete(true,  false, new NullProgressMonitor());
	
}
 
開發者ID:Adobe-Marketing-Cloud,項目名稱:aem-eclipse-developer-tools,代碼行數:23,代碼來源:NewGraniteProjectWizard.java

示例2: convertToMavenModel

import org.apache.maven.model.Parent; //導入方法依賴的package包/類
public static Model convertToMavenModel(MavenModel model, File projectDir) {
  Model result = new Model();
  result.setArtifactId(model.getMavenKey().getArtifactId());
  result.setGroupId(model.getMavenKey().getGroupId());
  result.setVersion(model.getMavenKey().getVersion());
  result.setPackaging(model.getPackaging());
  result.setName(model.getName());

  if (model.getParent() != null) {
    Parent parent = new Parent();
    MavenKey parentKey = model.getParent().getMavenKey();
    parent.setArtifactId(parentKey.getArtifactId());
    parent.setGroupId(parentKey.getGroupId());
    parent.setVersion(parentKey.getVersion());
    parent.setRelativePath(model.getParent().getRelativePath());
    result.setParent(parent);
  }

  result.setProperties(model.getProperties());
  result.setModules(model.getModules());
  result.setBuild(new Build());
  MavenBuild modelBuild = model.getBuild();
  convertToMavenBuildBase(modelBuild, result.getBuild(), projectDir);
  result.getBuild().setSourceDirectory(relativize(projectDir, modelBuild.getSources().get(0)));
  result
      .getBuild()
      .setTestSourceDirectory(relativize(projectDir, modelBuild.getTestSources().get(0)));

  result.getBuild().setOutputDirectory(modelBuild.getOutputDirectory());
  result.getBuild().setTestOutputDirectory(modelBuild.getTestOutputDirectory());

  result.setProfiles(convertToMavenProfiles(model.getProfiles(), projectDir));
  return result;
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:35,代碼來源:MavenModelUtil.java

示例3: getParentFromPreferernceStore

import org.apache.maven.model.Parent; //導入方法依賴的package包/類
private Parent getParentFromPreferernceStore() {
	Parent parent = new Parent();
	parent.setGroupId(preferencesService.getString("org.wso2.developerstudio.eclipse.platform.ui",
	                                               GLOBAL_PARENT_MAVEN_GROUP_ID, null, null));
	parent.setArtifactId(preferencesService.getString("org.wso2.developerstudio.eclipse.platform.ui",
	                                                  GLOBAL_PARENT_MAVEN_ARTIFACTID, null, null));
	parent.setVersion(preferencesService.getString("org.wso2.developerstudio.eclipse.platform.ui",
	                                               GLOBAL_PARENT_MAVEN_VERSION, null, null));
	parent.setRelativePath(null);
	return parent;
}
 
開發者ID:wso2,項目名稱:developer-studio,代碼行數:12,代碼來源:MavenDetailsPage.java

示例4: updateParent

import org.apache.maven.model.Parent; //導入方法依賴的package包/類
private void updateParent() {
	Parent parent = new Parent();
	parent.setArtifactId(getParentArtifactID());
	parent.setGroupId(getParentGroupID());
	parent.setVersion(getParentVersion());
	parent.setRelativePath(getParentRelativePath());
	mavenProjectInfo.setParentProject(parent);
	dataModel.setMavenInfo(mavenProjectInfo);
}
 
開發者ID:wso2,項目名稱:developer-studio,代碼行數:10,代碼來源:MavenDetailsPage.java

示例5: asParent

import org.apache.maven.model.Parent; //導入方法依賴的package包/類
private Parent asParent(Model model) throws IOException
{
	Parent parent = new Parent();
	parent.setGroupId(model.getGroupId());
	parent.setArtifactId(model.getArtifactId());
	parent.setVersion(model.getVersion());
	parent.setRelativePath(model.getPomFile().getCanonicalPath());
	return parent;
}
 
開發者ID:bnavetta,項目名稱:tycho-gen,代碼行數:10,代碼來源:DefaultWrapperGenerator.java

示例6: mergeParent_RelativePath

import org.apache.maven.model.Parent; //導入方法依賴的package包/類
protected void mergeParent_RelativePath( Parent target, Parent source, boolean sourceDominant,
                                         Map<Object, Object> context )
{
    String src = source.getRelativePath();
    if ( src != null )
    {
        if ( sourceDominant || target.getRelativePath() == null )
        {
            target.setRelativePath( src );
            target.setLocation( "relativePath", source.getLocation( "relativePath" ) );
        }
    }
}
 
開發者ID:gems-uff,項目名稱:oceano,代碼行數:14,代碼來源:ModelMerger.java


注:本文中的org.apache.maven.model.Parent.setRelativePath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。