maven常规设置:setting.xml & pom.xml

setting.xml


<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <localRepository>E:\apache-maven-3.6.3\resp</localRepository>
    <pluginGroups>
    </pluginGroups>
    <proxies>
    </proxies>
    <servers>
    </servers>
    <mirrors>
        <mirror>
            <id>alimaven</id>
            <name>aliyun maven</name>
            <url>https://maven.aliyun.com/repository/central</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
    </mirrors>
    <profiles>
    </profiles>
</settings>


<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>test</groupId>
    <artifactId>test_jdbc</artifactId>
    <version>0.0.2</version>
    <packaging>jar</packaging>

    <!-- <repositories> -->
        <!--     <repository> -->
            <!--         <id>central</id> -->
            <!--         <name>Central Repository</name> -->
            <!--         <url>https://repo.maven.apache.org/maven2</url> -->
            <!--         <layout>default</layout> -->
            <!--         <snapshots> -->
                <!--             <enabled>false</enabled> -->
                <!--         </snapshots> -->
            <!--     </repository> -->
        <!-- </repositories> -->
    <!--  -->
    <!-- <pluginRepositories> -->
        <!--     <pluginRepository> -->
            <!--         <id>central</id> -->
            <!--         <name>Central Repository</name> -->
            <!--         <url>https://maven.aliyun.com/repository/central</url> -->
            <!--         <layout>default</layout> -->
            <!--         <snapshots> -->
                <!--             <enabled>false</enabled> -->
                <!--         </snapshots> -->
            <!--         <releases> -->
                <!--             <updatePolicy>never</updatePolicy> -->
                <!--         </releases> -->
            <!--     </pluginRepository> -->
        <!-- </pluginRepositories> -->
    <!--  -->

    <build>
        <outputDirectory>./build</outputDirectory>
        <testOutputDirectory>./build/test </testOutputDirectory>
        <resources>
            <resource>
                <directory>./</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                    <exclude>**/*.app</exclude>
                    <exclude>**/*.sc</exclude>
                    <exclude>**/*.dic</exclude>
                    <exclude>**/*.re</exclude>
                    <exclude>**/*.org</exclude>
                </excludes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.1.0</version>
            </plugin>

            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.1.0</version>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </build>


    <dependencies>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.19</version>
        </dependency>

    </dependencies>

</project>

猜你喜欢

转载自www.cnblogs.com/sunrisecape/p/12660836.html