2017-12-12 3 views
0

Ich bin gerade dabei, ein JIRA Plugin zu entwickeln, das mir alle meine Benutzer, die ich in meiner JIRA Anwendung habe, geben wird.JIRA Java API Entwicklung - Atlas-run Compiler Fehler

Momentan verwende ich den Befehl atlas-run, um das Projekt zu kompilieren, während ich mich im Verzeichnis der JAR/XML-Dateien befinde.

ich vier Fehler im Moment:

[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 

Als ich an meinem Java-Code aussehen, kann ich sehen, dass die beiden Fehler in Zeile 4 idetified werden, 45 und 8, 55 existieren nicht:

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; 
    } 

} 

Mein zweiter Klasse, auf die verwiesen wird:

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); 


    } 

} 

ich mich gefragt, ob jemand hatte Erfahrung Mit diesem vorher? Ich glaube, dass das Problem mit den externen importierten Bibliotheken zu tun hat.

Antwort

0

Verwenden Sie eine IDE wie Eclipse, um diese häufigen Fehler wie Semikolon und geschweifte Klammern zu sehen. siehe zum Beispiel Ihre Import-Anweisung in GetUsers Klasse fehlt ein Semikolon

import com.atlassian.crowd.embedded.api.User 

sollte es

import com.atlassian.crowd.embedded.api.User; 

Semikolon fehlt sein.

Darüber hinaus müssen Sie

ListUser.class 

und nicht

ListUser.class() 

haben Wie ich bereits erwähnt bitte ein IDE beginnen.