K
K
kalaysolay2021-09-11 22:22:19
Java
kalaysolay, 2021-09-11 22:22:19

Why doesn't a pure Maven project start?

Hello everyone
There was a need for a telegram bot.
I found articles on how to make a bot in Java.
Download IDEA Community Edition. Created a new Maven project. Created a class and method Main and main, respectively, and wrote there System.out.println("TEST");
I run the project, it gives an error:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.260 s
[INFO] Finished at: 2021-09-12T00:56:05+06:00
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException

Process finished with exit code 1

613d012da4b63089305065.png

Googled this topic - basically everyone has a cant with a specific plugin.
I didn't add anything to "Run/debug configurations", I just created it via "Add new configuration -> Maven -> OK"
I didn't touch all IDE settings (and collector settings) at all.
613d0121895d1901971784.png

I start each phase from Maven -> Lifecycle. Crashes on "site" with the following error:
[WARNING] Report plugin org.apache.maven.plugins:maven-project-info-reports-plugin has an empty version.
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:3.1.2
[WARNING] Error injecting: org.apache.maven.report.projectinfo.CiManagementReport
java.lang.NoClassDefFoundError: org/apache/maven/doxia/siterenderer/DocumentContent

On stackoverflow, I saw advice to specify manually, so I specified the version manually in POM:
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>3.1.2</version>
        </plugin>
    </plugins>
    </build>

WARNING just left, but the error remained.

POM:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>untitled2</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>
    <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>3.1.2</version>
        </plugin>
    </plugins>
    </build>
</project>


Why such an error on a freshly installed IDE and an absolutely clean project without any plugins?
For maven, is this the norm for such hemorrhoids? :)
I spent half a day just to run ..

According to the advice from https://coderoad.ru/61056949/Run-file-maven-not... indicated in "Run/Debug configuration"
to the configuration in Command line value "deploy" and specified repository in POM (path was file:///Users/kaktak/.m2 ) - didn't help, crashes with "Error injecting: org.apache.maven.report.projectinfo.CiManagementReport
java.lang .NoClassDefFoundError: org/apache/maven/doxia/siterenderer/DocumentContent"

PS. why I use Java and why not take the bot constructor is another question. I just wanted to, at the same time I will teach java

Answer the question

In order to leave comments, you need to log in

5 answer(s)
K
kalaysolay, 2021-09-12
@kalaysolay

I decided this way, not without the help of Orkhan Hasanly Dmitry Roo
Before that, I tried to run the application through the created "Run / debug configuration" with the Maven type.
For my problem, it was enough to create a configuration of type "Application" and run Main.
613e3b87178fc814063779.png

O
Orkhan, 2021-09-11
Hasanly @azerphoenix

Good evening. Let's try to figure it out.
If you do not need plugins, then you can remove them.

<plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>3.1.2</version>
        </plugin>
    </plugins>

Is it normal for maven to have such hemorrhoids? :)

Of course not. You just decided to start learning Java and immediately decided to take up Maven. You could first study the language itself, and then study the build systems, but that's up to you)

Error injecting: org.apache.maven.report.projectinfo.CiManagementReport
java.lang.NoClassDefFoundError: org/apache/maven/doxia/siterenderer/DocumentContent

Here is some useful information:
This is caused by maven-project-info-reports-plugin updated to 3.0.0, and rely on doxia-site-renderer 1.8 (and have org.apache.maven.doxia.siterenderer.DocumentContent this class), but maven-site -plugin:3.3 rely on doxia-site-renderer:1.4 (and do not have org.apache.maven.doxia.siterenderer.DocumentContent)

https://stackoverflow.com/questions/51091539/maven...
You can use archetypes to quickly start a project. Specifically look for the maven quickstart archetype Screenshot
- https://i.imgur.com/tPVfFH9.png
Try the above solutions and then unsubscribe. You can also post the source of your project on github and send the link.

N
Nursultan Moldobaev, 2014-09-02
@Diyahon

SELECT *,
(SELECT t.cl_bal FROM table1 t
WHERE t.cl_bal_date = DATE_SUB(cl_bal_date,interval 1 day)
) as client_day_charger,
FROM table1

P
Puma Thailand, 2014-09-02
@opium

Ahahaha, I recognize the screen from the student manual that they didn’t go to couples?

K
Ketrin1003, 2014-09-03
@Ketrin1003

I enter on SQL server, swears on syntax. Maybe there is a different request?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question