小编geg*_*ege的帖子

JIRA - Jira post功能 - 如何更新"修复版本"字段?

我的方案是:我的jira工作流程中的一步应该具有取消计划任务的能力,即将修复版本设置为"无".

我注意到我无法在工作流后期功能中更新修复版本 - 我不确切知道为什么,但无论如何我确实实现了一个jira插件来帮助我解决我的问题,但我知道我反对jira结构(甚至java良好的编码实践:)).我不确定我的实现是否会导致问题,但实际上它在我的jira实例4.1.x中工作.

我如何实现一个插件来更新post函数中的修复版本,2个非常相似的方式:

public class BrandsclubPostFunctionUnschedule extends AbstractJiraFunctionProvider {
    // Here I create an empty Collection to be the new value of FixVersion (empty because I need no version in Fix Version)
    public void execute(Map transientVars, Map args, PropertySet ps) throws WorkflowException {
        MutableIssue issue = this.getIssue(transientVars);
        Collection<Version> newFixVersion = new ArrayList<Version>();
            issue.setFixVersions(newFixVersion);
            issue.store();
    }
}

public class BrandsclubPostFunctionUnschedule extends AbstractJiraFunctionProvider {
    // here I clear the Collection I got from "old" Fix Version …
Run Code Online (Sandbox Code Playgroud)

java plugins jira

10
推荐指数
1
解决办法
6662
查看次数

带WTP的多模块Maven2项目

我很难让我的Maven2多模块项目具有深度项目结构,在我的JBOSS 5服务器中显示为单个耳朵(具有依赖性 - 包括1个war,2个ejbs和1个jar)在我的Eclipse Ganymede中(选项卡服务器).

我一直在尝试使用Maven Eclipse插件将我的项目变成WTP项目但没有成功.因此,它们似乎部署在服务器中,它们显示为独立的项目.

我的项目有1个战争,2个ejbs和1个jar必须打包在耳内,每个"子项目"都是一个单独的模块.

Project的pom.xml(类型为pom):

...

<modules>
   <module>ejb1</module>
   <module>ejb2</module>
   <module>war</module>
   <module>jar</module>
   <module>ear</module>
</modules>
Run Code Online (Sandbox Code Playgroud)

...

耳模块仅负责将其他模块封装在一起.

有没有办法告诉eclipse(ganymede)所有这些项目(ejbs,war和jar)都在ear模块中,所以我可以在服务器中部署耳朵?

java eclipse maven-2 eclipse-wtp

6
推荐指数
1
解决办法
5612
查看次数

在运行时指定泛型集合类型参数(Java Reflection)

我想在运行时使用反射来获取集合的泛型类型.

代码(JAVA):

Field collectionObject = object.getClass().getDeclaredField(
    collectionField.getName());
//here I compare to see if a collection
if (Collection.class.isAssignableFrom(collectionObject.getType())) {
   // here I have to use the generic type of the collection 
   // to see if it's from a specific type - in this case Persistable
   if (Persistable.class.isAssignableFrom(GENERIC_TYPE_COLLECTION.class)) {
   }
}
Run Code Online (Sandbox Code Playgroud)

有没有办法在运行时在java中获取集合的泛型类型?在我的情况下,我需要集合的泛型类型.class.

提前致谢!

java reflection

5
推荐指数
2
解决办法
1万
查看次数

标签 统计

java ×3

eclipse ×1

eclipse-wtp ×1

jira ×1

maven-2 ×1

plugins ×1

reflection ×1