本文整理了Java中org.guvnor.common.services.project.model.Dependencies
类的一些代码示例,展示了Dependencies
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dependencies
类的具体详情如下:
包路径:org.guvnor.common.services.project.model.Dependencies
类名称:Dependencies
暂无
代码示例来源:origin: org.jbpm/jbpm-wb-integration-backend
private Dependencies getValidDependenciesForWorkitem(Dependencies projectDepends,
RepoData workitem,
boolean useVersionRange) {
Dependencies validDepends = new Dependencies();
Dependencies workItemDepends = new Dependencies();
workitem.getMavenDependencies().forEach(dep -> workItemDepends.add(new Dependency(new GAV(dep.getGroupId(),
dep.getArtifactId(),
resolveVersion(dep.getVersion(), useVersionRange)))));
for (Dependency depends : workItemDepends) {
if (!projectDepends.containsDependency(depends)) {
validDepends.add(depends);
}
}
return validDepends;
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-editor-client
private void updateWithOriginalDependency(final NormalEnhancedDependency enhancedDependency) {
final Dependency originalDependency = originalSetOfDependencies.get(enhancedDependency.getDependency());
enhancedDependency.setDependency(originalDependency);
}
代码示例来源:origin: kiegroup/appformer
public Collection<GAV> getCompileScopedGavs() {
return getGavs("compile",
// When scope is not declared (dependency.getScope() == null), maven considers it to be compile scope
null
);
}
代码示例来源:origin: kiegroup/drools-wb
void editPomIfNecessary(Path pomPath, POM projectPom, Dependencies dependencies, GAV gav) {
Dependency scenarioDependency = new Dependency(gav);
scenarioDependency.setScope("test");
if (!dependencies.containsDependency(gav)) {
dependencies.add(scenarioDependency);
pomService.save(pomPath, projectPom, null, "");
}
}
代码示例来源:origin: kiegroup/jbpm-wb
Dependencies workItemDepends = new Dependencies();
service.getMavenDependencies().forEach(dep -> workItemDepends.add(new Dependency(new GAV(dep.getGroupId(),
dep.getArtifactId(),
resolveVersion(dep.getVersion(), useVersionRange)))));
if (workItemDepends != null && workItemDepends.size() > 0) {
for (Dependency workitemDependency : workItemDepends) {
projectPOM.getDependencies().remove(workitemDependency);
代码示例来源:origin: kiegroup/appformer
@Before
public void setUp() {
dependencies = new Dependencies();
droolsCore = new Dependency(new GAV("org.drools:drools-core:5.0"));
droolsCore.setScope("compile");
dependencies.add(droolsCore);
Dependency junit = new Dependency(new GAV("junit:junit:4.11"));
junit.setScope("test");
dependencies.add(junit);
Dependency depWithoutScope = new Dependency(new GAV("mygroup:depWithoutScope:1.0"));
dependencies.add(depWithoutScope);
}
代码示例来源:origin: org.uberfire/uberfire-project-api
public Dependencies getDependencies() {
return new Dependencies(dependencies);
}
代码示例来源:origin: kiegroup/jbpm-wb
service,
useVersionRange);
if (validDependsFromWorkitem != null && validDependsFromWorkitem.size() > 0) {
for (Dependency workitemDependency : validDependsFromWorkitem) {
projectPOM.getDependencies().add(workitemDependency);
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-editor-client
public void addNew(final Dependency dependency) {
originalSetOfDependencies.add(dependency);
loader.addToQueue(dependency);
update();
}
代码示例来源:origin: org.uberfire/uberfire-project-backend
@Test
public void testLoad() throws Exception {
final URL url = this.getClass().getResource("/TestProject/pom.xml");
final Path path = ioService.get(url.toURI());
POM pom = service.load(Paths.convert(path));
assertEquals("org.test",
pom.getGav().getGroupId());
assertEquals("my-test",
pom.getGav().getArtifactId());
assertEquals("1.0",
pom.getGav().getVersion());
assertEquals(2,
pom.getDependencies().size());
assertContainsDependency("org.apache.commons",
"commons-lang3",
"compile",
pom.getDependencies());
assertContainsDependency("org.jboss.weld",
"weld-core",
"test",
pom.getDependencies());
}
代码示例来源:origin: kiegroup/appformer
@Test
public void testContainsGAV() {
assertThat(dependencies.containsDependency(new GAV("org.drools:drools-core:5.0"))).isTrue();
final Dependency dependency = new Dependency(new GAV("org.drools:drools-core:5.0"));
dependency.setScope("test");
assertThat(dependencies.containsDependency(dependency)).isTrue();
assertThat(dependencies.containsDependency(new GAV("org.drools:drools-core:4.0"))).isFalse();
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-editor-client
public void init(final POM pom,
final Callback<EnhancedDependencies> callback) {
loader.init(this);
this.originalSetOfDependencies = pom.getDependencies();
this.enhancedDependencies.clear();
addToQueue(originalSetOfDependencies.getCompileScopedGavs());
this.callback = callback;
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-editor-client
public void delete(final EnhancedDependency enhancedDependency) {
enhancedDependencies.remove(enhancedDependency);
originalSetOfDependencies.remove(enhancedDependency.getDependency());
update();
}
代码示例来源:origin: org.jbpm/jbpm-wb-integration-backend
Dependencies workItemDepends = new Dependencies();
service.getMavenDependencies().forEach(dep -> workItemDepends.add(new Dependency(new GAV(dep.getGroupId(),
dep.getArtifactId(),
resolveVersion(dep.getVersion(), useVersionRange)))));
if (workItemDepends != null && workItemDepends.size() > 0) {
for (Dependency workitemDependency : workItemDepends) {
projectPOM.getDependencies().remove(workitemDependency);
代码示例来源:origin: kiegroup/appformer
public Dependencies getDependencies() {
return new Dependencies(dependencies);
}
代码示例来源:origin: org.jbpm/jbpm-wb-integration-backend
service,
useVersionRange);
if (validDependsFromWorkitem != null && validDependsFromWorkitem.size() > 0) {
for (Dependency workitemDependency : validDependsFromWorkitem) {
projectPOM.getDependencies().add(workitemDependency);
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-datasource-mgmt-backend
URI resolveEmbedded(final String groupId,
final String artifactId,
final String version) throws IOException {
final POM projectPom = new POM(new GAV("resolver-dummy-group",
"resolver-dummy-artifact",
"resolver-dummy-version"));
projectPom.getDependencies().add(new Dependency(new GAV(groupId, artifactId, version)));
final String pomXML = pomContentHandler.toString(projectPom);
final InputStream pomStream = new ByteArrayInputStream(pomXML.getBytes(StandardCharsets.UTF_8));
final MavenProject mavenProject = MavenProjectLoader.parseMavenPom(pomStream);
for (org.apache.maven.artifact.Artifact mavenArtifact : mavenProject.getArtifacts()) {
if (groupId.equals(mavenArtifact.getGroupId()) &&
artifactId.equals(mavenArtifact.getArtifactId()) &&
version.equals(mavenArtifact.getVersion()) &&
mavenArtifact.getFile().exists()) {
return mavenArtifact.getFile().toURI();
}
}
return null;
}
}
代码示例来源:origin: org.guvnor/guvnor-project-backend
@Test
public void testLoad() throws Exception {
final URL url = this.getClass().getResource("/TestProject/pom.xml");
final Path path = ioService.get(url.toURI());
POM pom = service.load(Paths.convert(path));
assertEquals("org.test",
pom.getGav().getGroupId());
assertEquals("my-test",
pom.getGav().getArtifactId());
assertEquals("1.0",
pom.getGav().getVersion());
assertEquals(2,
pom.getDependencies().size());
assertContainsDependency("org.apache.commons",
"commons-lang3",
"compile",
pom.getDependencies());
assertContainsDependency("org.jboss.weld",
"weld-core",
"test",
pom.getDependencies());
}
代码示例来源:origin: kiegroup/appformer
@Test
public void testGetCompileScopedGavsMethod() {
final Collection<GAV> gavs = dependencies.getCompileScopedGavs();
assertThat(gavs).hasSize(2);
assertContains(gavs,
"org.drools",
"drools-core",
"5.0");
assertContains(gavs,
"mygroup",
"depWithoutScope",
"1.0");
}
}
代码示例来源:origin: kiegroup/jbpm-wb
private Dependencies getValidDependenciesForWorkitem(Dependencies projectDepends,
RepoData workitem,
boolean useVersionRange) {
Dependencies validDepends = new Dependencies();
Dependencies workItemDepends = new Dependencies();
workitem.getMavenDependencies().forEach(dep -> workItemDepends.add(new Dependency(new GAV(dep.getGroupId(),
dep.getArtifactId(),
resolveVersion(dep.getVersion(), useVersionRange)))));
for (Dependency depends : workItemDepends) {
if (!projectDepends.containsDependency(depends)) {
validDepends.add(depends);
}
}
return validDepends;
}
内容来源于网络,如有侵权,请联系作者删除!