使用Maven分类器作为依赖(Using the Maven classifier as a dependence)
我在工作空间中有一堆项目,每个项目都有自己的
pom.xml
,它使用maven-assembly-plugin生成自己的zip和一个名为foo的分类器,如下所示:<plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.4</version> <executions> <execution> <goals><goal>single</goal></goals> <phase>package</phase> <configuration> <classifier>foo</classifier> <descriptors> <descriptor>foo.xml</descriptor> </descriptors> </configuration> </execution> </executions> </plugin>
我还有一个项目,我打算用foo分类器使用maven-dependency-plugin复制上述项目中生成的所有jar,如下所示:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.9</version> <executions> <execution> <id>copy</id> <phase>package</phase> <goals> <goal>copy</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>my.group.id</groupId> <artifactId>project1</artifactId> <version>${project.version}</version> <classifier>foo</classifier> <type>zip</type> <overWrite>true</overWrite> </artifactItem> <!-- similar artifactItem tags for project, 2, 3, etc --> </artifactItems> </configuration> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>my.group.id</groupId> <artifactId>project1</artifactId> <version>${project.version}</version> <classifier>source</classifier> </dependency> </dependencies>
但是我收到这些pom文件的错误说: 找不到Project1:jar:foo:{version} -SNAPSHOT { http:// repositoryURL }缓存在本地存储库中,解决方案将不会重新尝试,直到更新间隔为代理中心已经过去或强制更新。
我不明白为什么当我打算从本地版本中复制时maven正试图从存储库下载它。 其他项目确实生成了相应的归档。 我错过了什么或做错了什么?
I have a bunch of projects in a workspace where each project has its own
pom.xml
which generates its own zip with a classifier called foo using the maven-assembly-plugin as below:<plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.4</version> <executions> <execution> <goals><goal>single</goal></goals> <phase>package</phase> <configuration> <classifier>foo</classifier> <descriptors> <descriptor>foo.xml</descriptor> </descriptors> </configuration> </execution> </executions> </plugin>
I have one more project where I intend to copy all of the jars generated in the above projects with the foo classifier using the maven-dependency-plugin as below:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.9</version> <executions> <execution> <id>copy</id> <phase>package</phase> <goals> <goal>copy</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>my.group.id</groupId> <artifactId>project1</artifactId> <version>${project.version}</version> <classifier>foo</classifier> <type>zip</type> <overWrite>true</overWrite> </artifactItem> <!-- similar artifactItem tags for project, 2, 3, etc --> </artifactItems> </configuration> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>my.group.id</groupId> <artifactId>project1</artifactId> <version>${project.version}</version> <classifier>source</classifier> </dependency> </dependencies>
But I get a error with these pom files saying: Failure to find Project1:jar:foo:{version}-SNAPSHOT in {http://repositoryURL} was cached in the local repository, resolution will not be reattempted until the update interval of proxy-central has elapsed or updates are forced.
I don't understand why maven is trying to download it from the repository when I just intend to do a copy from local builds. The other projects do have the appropriate archives generated. What am I missing or doing wrong?
原文:https://stackoverflow.com/questions/35586314
最满意答案
f.write(chunk)
应该这样做(而不是
f.write(1024)
。正如错误消息所述,
f.write
需要一个字符串参数,1024显然是一个int
f.write(chunk)
should do it (instead of
f.write(1024)
.As the error message states,
f.write
expects a string parameter, and 1024 is clearly anint
相关问答
更多-
由于命令和文件名位于不同的行中,因此最好按行解析接收的数据。 块数据的最后部分不必以\n结束,因此必须与下一个接收的数据块合并。 这是(未经测试)按行解析接收数据的实现: data = '' # contains last line of a read block if it didn't finish with \n in_get, in_done, reading_file, ended = False, False, False, False while not ended: if len(dat ...
-
对于问题1:发送ACK,你可以复制你反向的内容。 After many attempts to get a simple acknowledgment reply from my server this did it. Beyond literally starting completely over each round, the time.sleep(.1) function was the only missing key. It allowed the server and client both ...
-
首先,您在这里使用TCP执行最常见的错误:假设在单个send()中发送的所有数据将在单个recv()中获得相同的结果。 这对于TCP来说是不真实的,因为它是一个八位字节流,而不是消息流。 您的代码仅在理想(实验室)条件下工作,并且可能在现实世界中使用时神秘失败。 您应该在TCP流中明确地发明消息边界,或者切换到例如SCTP。 后者现在几乎可以在任何地方使用,并通过网络连接保持消息边界。 第二个错误与第一个错误直接相关。 发送文件时,不提供文件已完成的任何明确标记。 所以,客户永远等待。 您可能尝试关闭服务器 ...
-
不要使用UDP传输大文件,请使用TCP。 UDP不会让您发送的所有数据包都到达,或者如果它们按顺序到达,它们甚至可能被复制。 此外,UDP不适合大型传输,因为1)它没有拥塞控制,所以你只会泛滥网络,数据包将被丢弃,2)你必须将你的数据包分解成较小的数据包通常大约1400字节是建议保持在MTU以下,否则如果您依赖IP碎片并且丢失了一个片段,则整个文件都将丢失。您必须编写自定义代码来修复UDP的所有这些问题,因为文件传输需要一切都可靠地发送。 另一方面,TCP已经完成了所有这些,它是可靠的,具有拥塞控制并且无处 ...
-
为什么这个SocketServer在Python中运行而不是IronPython?(Why does this SocketServer work in Python but not IronPython?)[2023-10-07]
我想我可以回答我自己的问题。 事实证明,我必须更改对socket.makefile的调用以显式指定二进制模式。 即: f = self.request.makefile('b') 我认为这归结为IronPython中一个略有不同的实现。 I think I can answer my own question. It turns out that I had to change the call to socket.makefile to explicitly specify binary mode. I ... -
Ironpython查询(Ironpython query)[2021-12-17]
也许这会很有用: http : //www.ironpython.net/documentation/dotnet/ Maybe this will be useful: http://www.ironpython.net/documentation/dotnet/ -
使用pickle将Array [Byte]从ironpython传递给python(passing Array[Byte] from ironpython to python using pickle)[2023-09-13]
经过一些测试,我找到的最有效的解决方案是这样的: 首先,将Array [Byte]转换为python字符串: data_str = str(buffer(data)) 我不完全确定buffer是做什么的,但它似乎是高效计算所必需的, 这里有一些解释。 然后发送到cpython(在我的情况下通过套接字,cpython在linux机器上运行)并转换为元组: #data_str is an RGB image with dims sx and sy format_str = str(sx*sy*3).strip ... -
ironPython - python套接字文件传输,typeError(ironPython - python socket file transfer, typeError)[2024-05-09]
f.write(chunk) 应该这样做(而不是f.write(1024) 。 正如错误消息所述, f.write需要一个字符串参数,1024显然是一个int f.write(chunk) should do it (instead of f.write(1024). As the error message states, f.write expects a string parameter, and 1024 is clearly an int -
我也用JavaScriptSerializer完成了它。 如下: peopleJson = '''[ {"name":"Jon", "age": "29", canSing:false, favColors:["red", "white"]}, {"name":"Lilly", "age": "55", "canSing": true} ]''' #convert json to string import clr clr.AddReference('System.Web.Extension ...
-
对您对示例代码的误解表示歉意,并感谢您添加服务器和客户端调用! 请注意,您获得的错误消息与加密无关。 您可以阅读base64.py库的相关部分:错误消息指示base64数据无效。 特别是,它最后没有正确填充。 有了额外的呼叫站点信息,我认为问题在于您正在加密,然后单独编码客户端上每个1024字节的数据块。 然后,在服务器上,您正在从网络读取1024个字节并尝试解码它。 但是,base64编码会增加原始数据的长度,因此您将读取的只是编码格式的前1024个字节,这将是截断的base64消息(因此填充不正确)。 ...