我使用程序集插件创建了几个包含一些类的jar.我需要生成的罐子的自定义名称:app_business.jar app_gui.jar core.jar等.
目前我必须遵循以下配置:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<finalName>app_business</finalName>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
<attach>true</attach>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
一个assembly.xml文件:
<assembly>
<id>app_business</id>
<formats>
<format>jar</format>
</formats>
<baseDirectory>target</baseDirectory>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.build.outputDirectory}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>org/xyz/**</include>
</includes>
</fileSet>
</fileSets>
</assembly>
Run Code Online (Sandbox Code Playgroud)
这会创建一个完美的文件app_business.jar.但我不知道如何创建我的其他文件.选项appendAssemblyId对我没有帮助,因为它以AppName-app_business.jar格式创建文件名.我真的需要确切的文件名app_business.jar.
任何的想法?非常感谢你!
我正在使用一台我没有管理员权限的机器,我需要在JAVA_HOME每次启动时设置.
因此,我想编写一个classpath自动设置所需的脚本.
我该怎么做呢?
length()的perldoc页面告诉我,我应该使用以字节为单位查找Unicode字符串,或者字节页面回应它.bytes::length(EXPR)
use bytes;
$ascii = 'Lorem ipsum dolor sit amet';
$unicode = 'Lørëm ípsüm dölör sît åmét';
print "ASCII: " . length($ascii) . "\n";
print "ASCII bytes: " . bytes::length($ascii) . "\n";
print "Unicode: " . length($unicode) . "\n";
print "Unicode bytes: " . bytes::length($unicode) . "\n";
Run Code Online (Sandbox Code Playgroud)
但是,此脚本的输出不同于该联机帮助页:
ASCII: 26
ASCII bytes: 26
Unicode: 35
Unicode bytes: 35
Run Code Online (Sandbox Code Playgroud)
在我看来,length()和bytes :: length()对于ASCII和Unicode字符串都返回相同的值.我的编辑器设置默认将文件写为UTF-8,所以我认为Perl将整个脚本解释为Unicode,这意味着length()会自动正确处理Unicode字符串吗?
编辑:看我的评论; 我的问题没有多大意义,因为在上面的例子中,length()不能正常工作 - 它以字节为单位显示Unicode字符串的长度,而不是字符.我最初偶然发现的共鸣是一个程序,我需要在HTTP消息中设置Content-Lenth头(以字节为单位).我已经阅读了Perl中的Unicode,并且期望必须做一些有意义的工作,但是当length()完全返回我需要的蝙蝠时,我很困惑!见接受的答案对的概述use utf8,use bytes以及 …
我使用Delphi和Firebird 1.5开发了一个应用程序,其中服务器与应用程序位于同一台机器上.我现在正在将应用程序部署到另一个站点,其中Firebird服务器(Superserver)在一台计算机(NT4)上运行,而客户端在另一台计算机上运行.
如果我在application(t:\db\cinema.gdb)中包含限定路径,应用程序可以连接到数据库,但我自然希望使用别名,以便相同的代码可以在我的开发机器上(使用本地服务器).
那么,有两个问题:
cinema = t:\db\cinema.gdb,假设数据库位于映射驱动器上?cinema = 192.168.2.121:f:firebird\db\cinema.gdb,使用服务器的IP地址和服务器看到的数据库的路径?什么是.NET中的托管模块?它与Assemblies有何不同?PE文件(例如test.dll)是托管模块还是程序集?汇编/托管模块如何与磁盘上的物理文件相对应?
在C#winforms中,当我们显示一个消息框时,它在标题栏中没有标题,并且在任务栏的按钮中没有标题.
如果我想为消息框设置标题和图标该怎么办?
一个选项是创建一个出现的表单,其行为就像一个消息框,我可以在需要时显示和隐藏它.是的,可以做但我想修改"MessageBox"
我想隐藏我的div元素和我的整个滚动条body,但仍然让用户使用鼠标滚轮或箭头键滚动.如何使用原始JavaScript或jQuery实现这一目标?有任何想法吗?
我知道我不应该暴露一个List<T>属性,但我想知道这样做的正确方法是什么?例如,这样做:
public static class Class1
{
private readonly static List<string> _list;
public static IEnumerable<string> List
{
get
{
return _list;
//return _list.AsEnumerable<string>(); behaves the same
}
}
static Class1()
{
_list = new List<string>();
_list.Add("One");
_list.Add("Two");
_list.Add("Three");
}
}
Run Code Online (Sandbox Code Playgroud)
允许我的来电者简单地回到List<T>:
private void button1_Click(object sender, EventArgs e)
{
var test = Class1.List as List<string>;
test.Add("Four"); // This really modifies Class1._list, which is bad™
}
Run Code Online (Sandbox Code Playgroud)
所以,如果我想要一个真正不可变的List<T>,我总是要创建一个新的列表?例如,这似乎有效(测试在转换后为null):
public static IEnumerable<string> List
{
get
{
return new ReadOnlyCollection<string>(_list); …Run Code Online (Sandbox Code Playgroud) 如何将应用程序设置为生产模式?
好吧,这一定是不费脑子的,但我要部署我的第一个Rails应用程序,我已经正确设置了一切:Ubuntu Hardy,Passenger,MySQL.但是,它仍然在开发模式下运行.我只能找到旧版本Rails的文档,并希望确保我做得对.
提前致谢.
c# ×3
.net ×2
mysql ×2
aliases ×1
assemblies ×1
browser ×1
cmd ×1
css ×1
delphi ×1
firebird ×1
jar ×1
javascript ×1
jquery ×1
macros ×1
maven-2 ×1
messagebox ×1
passenger ×1
perl ×1
production ×1
properties ×1
scripting ×1
scrollbar ×1
shell ×1
sql ×1
title ×1
unicode ×1
utf-8 ×1
windows ×1
winforms ×1