我很遗憾在这里听起来很无知,但我是Maven的新手,并且一直在抨击我肯定非常简单的事情.
该文件说:
[...]项目可以生成一个ZIP程序集,其中包含根目录中项目的JAR工件,lib /目录中的运行时依赖项以及用于启动独立应用程序的shell脚本.
这正是我想要做的!但我似乎无法实现它.
我的POM如下:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.anearalone</groupId>
<artifactId>myapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
[...]
<build>
<finalName>myapp</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assemble/dist.xml</descriptor>
</descriptors>
<archive>
<manifest>
<mainClass>com.anearalone.myapp.CLI</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
[...]
</project>
Run Code Online (Sandbox Code Playgroud)
引用的dist.xml如下所示:
<assembly>
<id>dist</id>
<formats>
<format>zip</format>
</formats>
<files>
<file>
<outputDirectory>/</outputDirectory>
<source>src/main/bin/arkify.sh</source>
<fileMode>755</fileMode>
</file>
</files>
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<includes>
<include>*:jar</include>
</includes>
<outputDirectory>/lib</outputDirectory>
</dependencySet>
<dependencySet>
<useProjectArtifact>true</useProjectArtifact>
<includes>
<include>com.anearalone:myapp:jar:0.0.1-SNAPSHOT</include>
</includes>
<outputDirectory>/</outputDirectory>
</dependencySet>
</dependencySets>
</assembly> …Run Code Online (Sandbox Code Playgroud) 如何在solr中存储日期范围?
我需要存储开始日期和结束日期.
让我们说它是一个别墅,在一段时期(开始和结束)出租.
我必须使用两个字段吗?
在搜索中,用户可以选择开始日期和结束日期,所以在查询solr时我想我可以使用类似的东西:
date:[$start TO $end]
Run Code Online (Sandbox Code Playgroud)
但这只查询一个字段,这很好,但存储日期范围是我的问题.
Hmmmmm.
有帮助吗?
谢谢
我有一个用Python编写的实用程序,可以单独使用,也可以与其他shell实用程序一起使用.因此,我的实用程序退出状态代码(例如,0如果一切正常,1输入文件或输出目录不存在时等).
我的问题:我正在使用argparse模块,它工作得很好,不仅用于解析选项,还用于生成帮助.但是,我希望能够将有关退出状态的一些信息添加到帮助中.这有可能与argparse; 我错过了什么吗?
我有一个模型,我只想返回JSON,无论URI上的任何连接或类似文件的扩展(例如/app/model.json).Google-fu即将推出,这不会那么困难.