我有一个文件夹结构
/com/cdy/ws/a.class files
/com/cdy/ws/b.class files
/com/cdy/ws/c.class files
Run Code Online (Sandbox Code Playgroud)
当我运行以下命令"jar cvf asd.jar*.class"时,它给jar提供了所有类文件.但是没有生成文件夹结构.所有类文件都必须在"com.cdy/ws"下,但所有类都在META-INF的相同级别.谁能告诉我生成包结构的命令是什么?
谢谢
我正在尝试使用apache maven创建一个包.当我运行mvn clean install命令时,它给出了以下错误:
javax.servlet缺少dependencies.dependency.version':servlet-api.jar
我把'servlet-api.jar'放在我项目的资源文件夹中
任何人都可以告诉我应该在哪里放置该jar文件?
更新:这是我的pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>felix-parent</artifactId>
<groupId>org.apache.felix</groupId>
<version>2.1</version>
<relativePath>../pom/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.4.1-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>Maven Bundle Plugin</name>
<description>
Provides a maven plugin that supports creating an OSGi bundle
from the contents of the compilation classpath along with its
resources and dependencies. Plus a zillion other features.
The plugin uses the Bnd tool (http://www.aqute.biz/Code/Bnd)
</description>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/felix/trunk/bundleplugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/felix/trunk/bundleplugin</developerConnection>
<url>http://svn.apache.org/repos/asf/felix/trunk/bundleplugin</url>
</scm>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin> …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用maven-bundle-plugin创建一个包.该项目的pom.xml是:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.adobe.support.examples</groupId>
<artifactId>com.adobe.support.examples.osgi.service</artifactId>
<version>1.0.8</version>
<packaging>bundle</packaging>
<name>OSGi Service Example</name>
<url>http://blogs.adobe.com/kmossman</url>
<description>Adobe Developer Support OSGi Service Example</description>
<!--
Credit: This example is based on Moritz Havelock's http://in-the-sling.blogspot.com/
I suggest you use the most current versions of the plugin's.
Search the Central Repository for the most current versions http://search.maven.org/
Use the search strings below and update the appropriate versions
// Felix
g:"org.apache.felix" a:"org.apache.felix.framework"
g:"org.apache.felix" a:"maven-bundle-plugin"
g:"org.apache.felix" a:"maven-scr-plugin"
g:"org.apache.felix" a:"org.osgi.core"
// Maven
g:"org.apache.maven.plugins" a:"maven-compiler-plugin"
// Sling
g:"org.apache.sling" a:"maven-sling-plugin" …Run Code Online (Sandbox Code Playgroud) 当我们有5个切换用例时,switch语句非常好,但是在我们的情况下,我们有15个切换用例。
我想知道什么是Java中switch语句的最佳替代选择
private OpwaardernId getOpwaardernId(String opId) {
OpwaardernId opwaardernId;
switch (opId) {
case "ID001":
opwaardernId = opwaardernId.of("xxx");
break;
case "ID002":
opwaardernId = opwaardernId.of("123");
break;
case "ID002":
opwaardernId = opwaardernId.of("abc");
break;
case "ID003":
opwaardernId = opwaardernId.of("asd");
break;
case "ID004":
opwaardernId = opwaardernId.of("rrr");
break;
case "ID005":
opwaardernId = opwaardernId.of("ttt");
break;
...
case "ID015":
opwaardernId = opwaardernId.of("aaa");
break;
default:
opwaardernId = null;
}
return opwaardernId;
}
Run Code Online (Sandbox Code Playgroud) 下面是我的 HTML 片段,
<div class="direct-service hide">
..
<input handle="input" type="hidden" name="./season" value="spring">
<input handle="input" type="hidden" name="./season" value="">
...
</div>
Run Code Online (Sandbox Code Playgroud)
我想迭代直接服务类中的所有元素并查找 . /season name 属性并检查该值是否为空。如果它是空的,我需要将元素修改为
<input handle="input" type="hidden" name="./season@Empty" value="">
Run Code Online (Sandbox Code Playgroud)
我尝试使用以下代码获取基于值的名称属性
$("input[name='./season']").val();
Run Code Online (Sandbox Code Playgroud)
但它给了我第一个元素的值,而不给我第二个元素。似乎我需要扫描 div 类中的所有元素。您能告诉我处理此案的最佳方法吗?