java、scala混编maven打包依赖模板

<build>
		<resources>
			<resource>
				<directory>src/main/java</directory>
				<includes>
					<include>**/*.properties</include>
					<include>**/*.xml</include>
				</includes>
				<filtering>true</filtering>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
		</resources>
        <plugins>
        	<plugin>  
    			<groupId>org.apache.maven.plugins</groupId>  
   				<artifactId>maven-shade-plugin</artifactId>  
    			<version> 3.0.0</version>  
    			<executions>  
        			<execution>  
            			<phase>package</phase>  
            			<goals>  
                			<goal>shade</goal>  
            			</goals>  
            			<configuration>  
            				<createDependencyReducedPom>false</createDependencyReducedPom>
                			<transformers>  
                    			<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">  
									<mainClass>main class path</mainClass>  
                    			</transformer>  
                			</transformers>  
            			</configuration>  
        			</execution>  
    			</executions>  
			</plugin>  
            <plugin>
                <groupId>org.scala-tools</groupId>
                <artifactId>maven-scala-plugin</artifactId>
                <version>2.15.2</version>
                <executions>
                    <execution>
                        <id>scala-compile-first</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>add-source</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>scala-test-compile</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
</build>
posted @ 2020-08-07 22:36  sssuperMario  阅读(389)  评论(0编辑  收藏  举报