首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JIRA Java API开发-图谱-运行编译器错误

JIRA Java API开发-图谱-运行编译器错误
EN

Stack Overflow用户
提问于 2017-12-12 14:10:11
回答 1查看 132关注 0票数 0

我目前正在开发一个JIRA插件,它将为我提供我在JIRA应用程序中的所有用户。

目前,我在JAR/XML文件目录中使用atlas-run命令编译项目。

我现在有四个错误:

代码语言:javascript
复制
[INFO] 4 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.577 s
[INFO] Finished at: 2017-12-12T14:06:22+00:00
[INFO] Final Memory: 23M/447M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
7.0:compile (default-compile) on project myPlugin: Compilation failure: Compilat
ion failure:
[ERROR] /C:/Users/bed2scp/workspace/myPlugin/src/main/java/com/atlassian/tutoria
l/myPlugin/api/GetUsers.java:[4,45] ';' expected
[ERROR] /C:/Users/bed2scp/workspace/myPlugin/src/main/java/com/atlassian/tutoria
l/myPlugin/api/UserToCSV.java:[8,55] ')' expected
[ERROR] /C:/Users/bed2scp/workspace/myPlugin/src/main/java/com/atlassian/tutoria
l/myPlugin/api/UserToCSV.java:[8,56] illegal start of type
[ERROR] /C:/Users/bed2scp/workspace/myPlugin/src/main/java/com/atlassian/tutoria
l/myPlugin/api/UserToCSV.java:[8,57] <identifier> expected
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption

当我查看我的Java代码时,我可以看到在第4、45和8、55行中被理想化的两个错误并不存在:

代码语言:javascript
复制
import com.atlassian.jira.user.ApplicationUser;
import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.user;
import com.atlassian.jira.user.util.UserManager;
import com.atlassian.jira.api;
import com.bosch.plugin.user.list.impl.MyPluginComponentImpl;
import com.atlassian.jira.web.action.admin.user.UserBrowser;
import com.sun.istack.internal.Nullable;
import com.atlassian.jira.user.UserKeyService;

import java.lang.String;
import java.util.ArrayList;
import java.util.Collection;
import javax.annotation.*;


@RunWith(AtlassianPluginsTestRunner.class)
public class GetUsers
{
    private String name;
    private String userName;
    private long directoryId;
    private String emailAddress;
    private boolean isActive;

    public void Validator(String name, String userName, long directoryId, String emailAddress, boolean isActive)
    {
        this.name = name;
        this.userName = userName;
        this.emailAddress = emailAddress;
        this.isActive = isActive;
    }

    public static void main(String[] args) {
        System.out.println("entry point of app");
    }

    //compare user name
    public int compareTo(User user){
        return name.compareTo(user.getName());
    }

    //getter and setter for name
    public String getName(){
        return name;
    }

    //getter and setter for user name
    public String getuserName(){
        return userName;
    }
    //getter and setter for email
    public String getEmailAddress(){
        return emailAddress;
    }
    //getter and setter for directory ID in JIRA
    public long getDirectoryId(){
        return directoryId;
    }
    //getter and setter for checking if user is active
    public boolean isActive(){
        return isActive;
    }

    public User userIterator(User loggedInUser, Project currentProject) {
        loggedInUser = authenticationContext.getLoggedInApplicationUser();
        return loggedInUser;
    }

    public ArrayList<User> getAllUsers(){
        ArrayList<User> all = new ArrayList<User>(getAllUsers());
        return all;
    }

    public ArrayList<User> getAllUsersInGroups(Collection<String> arg0){
        ArrayList<User> allUsersandGroups = new ArrayList<User>(getAllGroups());
        return allUsersandGroups;
    }

    public ArrayList<User> getAllGroups(){
        ArrayList<User> allGroups = new ArrayList<User>(getGroups());
        return allGroups;
    }

}

我的第二节课被引用:

代码语言:javascript
复制
import java.io.FileWriter;
import java.util.Logging;


public class UserToCSV extends GetUsers {
    final Logger LOG = Logger.getLogger(ListUser.class());

    public void exportToCSV(){
        final String[] HEADER = {"Application", "Username", "Fullname", "Authorization"};
        FileWriter fileWriter = new FileWriter(fileWriter);


    }

}

我想知道以前有没有人有过这方面的经验?我相信问题与外部导入的图书馆有关。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-12-13 09:48:02

使用像Eclipse这样的IDE来查看这些常见的错误,比如分号和大括号缺失。例如,请参见GetUsers类中的导入语句缺少分号

代码语言:javascript
复制
import com.atlassian.crowd.embedded.api.User

它应该是

代码语言:javascript
复制
import com.atlassian.crowd.embedded.api.User;

分号不见了。

同时你也需要

代码语言:javascript
复制
ListUser.class 

而不是

代码语言:javascript
复制
ListUser.class()

正如我前面提到的,请开始使用IDE。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47774667

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档