美文网首页
Maven常见问题

Maven常见问题

作者: small瓜瓜 | 来源:发表于2019-12-05 01:20 被阅读0次

    指定jdk的版本

       <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.2</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    

    springboot生成的jar没有主配置清单

                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <configuration>
                        <fork>true</fork>
                    </configuration>
                </plugin>
    

    maven生成的jar包

    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.1</version>
    </dependency>
    
    <build>
      <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>3.2.1</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                            <goal>shade</goal>
                    </goals>
                        <configuration>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>org.feilong.mysql.SelectTest</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                </execution>
            </executions>
         </plugin>
      </plugins>
    </build>
    

    参考文章

    相关文章

      网友评论

          本文标题:Maven常见问题

          本文链接:https://www.haomeiwen.com/subject/yskmpctx.html