我的项目具有以下结构。
$tree
.
├── [4.0K] src/
│ └── [4.0K] main/
│ └── [4.0K] java/
│ └── [4.0K] org/
│ └── [4.0K] jfrog/
│ └── [4.0K] example/
│ └── [6.2K] ClientExample.java
├── [1.3K] pom.xml
└── [ 781] README.md
这是来自的示例程序
如果我这样做,mvn compile
我会得到以下输出。
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-example 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ maven-example ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/karthik/Workspace/project-examples/artifactory-client-java-examples/maven-example/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ maven-example ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /home/karthik/Workspace/project-examples/artifactory-client-java-examples/maven-example/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.592 s
[INFO] Finished at: 2018-09-13T12:03:07+12:00
[INFO] Final Memory: 18M/135M
[INFO] ------------------------------------------------------------------------
如果我尝试运行生成的 jar 文件。
java -jar target/maven-example-1.0-SNAPSHOT.jar
我收到以下错误。
no main manifest attribute, in target/maven-example-1.0-SNAPSHOT.jar
由于这是来自JFrog github repository
我希望它能够工作。我究竟做错了什么?
将项目导入 IntelliJ IDE 构建并尝试运行会给出以下结果。构建看起来成功 ( jar file gets generated inside target folder
)
但是,当我按运行时,我会被定向到以下页面。
交互式爱情
相关分类