Compile Traccar Error

Developer6 years ago

How to solve this problem?

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project traccar: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Anton Tananaev6 years ago

From the information you provided it's not possible to know what the issue is.

Developer6 years ago

Iam sorry iam new with traccar, but howto compile traccar from console? to debug

Anton Tananaev6 years ago

Traccar is a standard Java project. There is nothing unique about it. Read this:

https://www.traccar.org/build/

Developer6 years ago

OK, I get error from main class, Context class exist but i get error like this

Main 

public static void main(String[] args) throws Exception {
        Locale.setDefault(Locale.ENGLISH);
        args=new String[]{"D://projects//java//traccar//default.xml"};
        Context.init(args);
        Log.info("Starting server...");  
        Context.getServerManager().start();
        if (Context.getWebServer() != null) {
            Context.getWebServer().start();
        }

        new Timer().scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
                try {
                    Context.getDataManager().clearHistory();
                } catch (SQLException error) {
                    Log.warning(error);
                }
            }
        }, 0, CLEAN_PERIOD);

        Runtime.getRuntime().addShutdownHook(new Thread() {
            @Override
            public void run() {
                Log.info("Shutting down server...");

                if (Context.getWebServer() != null) {
                    Context.getWebServer().stop();
                }
                Context.getServerManager().stop();
            }
        });
    }

--- exec-maven-plugin:1.2.1:exec (default-cli) @ traccar ---
Exception in thread "main" java.lang.NoClassDefFoundError: org/traccar/Context
    at org.traccar.Main.main(Main.java:32)
Caused by: java.lang.ClassNotFoundException: org.traccar.Context
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 1 more
Developer6 years ago

This is really funny, after adding try catch on init function inside Context class everything is back work, confused....

leninweblb6 years ago

Why do you want to compile the project?
If you did some changes in the front-end, only execute the uglify.
The compilation is only necessary if you did some change in the backend.

Best Regards.
Lenin