• Maven的安装


    1.解压maven包

    2.创建maven目录(注意路径中不要有中文)里面包含maven和相对应的本地仓库

    3.修改maven中的中的settings.xml配置文件,修改该节点  <localRepository>E:/maven/repository</localRepository>

    将路径指向解压后的本地仓库路径

    4. 配置maven的环境变量

    将变量加入到path路径下

    5.设置IDEA的maven路径

    6.创建maven项目

    IDEA.exe中,File-->project-->maven

    7.配置文件

    <?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>com.beicai</groupId> <!--创建maven项目的时候-->
    <artifactId>scala_1608c</artifactId><!--创建maven项目的时候-->
        <version>1.0-SNAPSHOT</version>

    <properties>
    <encoding>UTF-8</encoding>
    <scala.version>2.10.6</scala.version>
    </properties>

    <dependencies>
    <dependency>
    <groupId>org.scala-lang</groupId>
    <artifactId>scala-library</artifactId>
    <version>${scala.version}</version>
    </dependency>
    </dependencies>

    <build>
    <sourceDirectory>src/main/scala</sourceDirectory><!--java和scala看自己-->
    <testSourceDirectory>src/test/scala</testSourceDirectory><!--java和scala看自己-->

    <plugins>
    <plugin>
    <groupId>net.alchim31.maven</groupId>
    <artifactId>scala-maven-plugin</artifactId>
    <version>3.2.2</version>
    <executions>
    <execution>
    <goals>
    <goal>compile</goal>
    <goal>testCompile</goal>
    </goals>
    <configuration>
    <args>
    <arg>-make:transitive</arg>
    <arg>-dependencyfile</arg>
    <arg>${project.build.directory}/.scala_dependencies</arg>
    </args>
    </configuration>
    </execution>
    </executions>
    </plugin>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>2.4.3</version>
    <executions>
    <execution>
    <phase>package</phase>
    <goals>
    <goal>shade</goal>
    </goals>
    <configuration>
    <filters>
    <filter>
    <artifact>*:*</artifact>
    <excludes>
    <exclude>META-INF/*.SF</exclude>
    <exclude>META-INF/*.DSA</exclude>
    <exclude>META-INF/*.RSA</exclude>
    </excludes>
    </filter>
    </filters>
    <transformers>
    <transformer
    implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
    <mainClass></mainClass>
    </transformer>
    </transformers>
    </configuration>
    </execution>
    </executions>
    </plugin>
    </plugins>
    </build>
    </project>

     有报错的地方,把鼠标放在报错的地方,按Alt+回车,会自动下载

    8.创建maven项目中碰到的错

      找不到maven

      

      

  • 相关阅读:
    【ABAP系列】SAP ABAP OOALV 动态设置单元格可否编辑
    【HANA系列】SAP HANA使用XS和HTTP创建proxy
    【HANA系列】SAP HANA SLT在表中隐藏字段并传入HANA的方法
    【BW系列】SAP 讲讲BW/4 HANA和BW on HANA的区别
    【HANA系列】SAP HANA 2.0 SPS00 SDA(Smart Data Access)连接Hadoop
    【BW系列】SAP BW on HANA 迁移问题
    【HANA系列】SAP HANA行列转换
    【HANA系列】SAP ECLIPSE中创建ABAP项目失败原因解析
    开放-封闭原则
    单一职责原则
  • 原文地址:https://www.cnblogs.com/lishengnan/p/maven.html
Copyright © 2020-2023  润新知