Home > Blockchain >  not getting jre system library in maven project in eclipse java
not getting jre system library in maven project in eclipse java

Time:12-29

here is img

Not getting java support after creating maven project in eclipse when maven project created I am not getting src/main/java,src/test/java and jre system libraries folders. i am following steps to create new project steps to create

** maven project: File-->new-->project-->select maven project-->next-->select create a simple project-->next-->give project id and artifact id-->finish.**

<?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>MavenProject1</groupId>
  <artifactId>MavenProject1</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <name>MavenProject1</name>
  <!-- FIXME change it to the project's website -->
  <url>http://www.example.com</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
      <plugins>
        <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.0.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.0.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
        <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.7.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>

CodePudding user response:

Yes, you wont get that. Its just a basic, very simple maven project that eclipse creates for you, so that you can structure the project as you like.

You now have 2 options:

  1. create all the structuring by yourself
  2. Create a new maven project and instead of selecting select create a simple project, select from archetype, and from there you can you can select what you like (Ex: maven-archetype-quickstart ) according to what you like.

For more info on setting up maven project with arch type search in youtube. You will get a lot of video tutorials.

CodePudding user response:

It sounds like you are not seeing the expected folder structure in your Eclipse project after creating a new Maven project.

By default, a Maven project should have the following folder structure:

├── src
│   ├── main
│   │   ├── java
│   │   ├── resources
│   ├── test
│   │   ├── java
│   │   ├── resources
├── pom.xml

The src/main/java folder is where you should put your project's main source code, and the src/test/java folder is where you should put your test code.

If you are not seeing these folders in your Eclipse project, there are a few things you can try:

  1. Make sure that you selected the "Create a simple project (skip archetype selection)" option when creating the Maven project. This should create the default folder structure for you.

  2. If you already created the project and did not select this option, you can try manually creating the src/main/java and src/test/java folders in your project. Right-click on the project in the Eclipse Package Explorer, select "New" > "Folder", and enter the desired folder names.

If you are still not seeing the expected folder structure, it is possible that there is an issue with your Eclipse Maven plugin or with your Eclipse installation. You may want to try reinstalling the Maven plugin or re-importing the project into Eclipse.

  • Related