Saturday, April 4, 2015

Project Maven

export file jar

1. chỉnh sửa file pom.xml
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <finalName>upload</finalName>
                </configuration>
            </plugin>
        </plugins>
    </build>
2. clean project và export file
mvn clean
mvn eclipse:clean
mvn eclipse:eclipse
mvn package
3.chạy file .jar trong moi truong linux
sudo java -cp file.jar xxxx.YYYY
trong đó xxxx là tên package(nếu có) chứa class YYYY

No comments:

Post a Comment