Why isn't clover generating JSON from my pom.xml config?

时间:2017-08-30 20:27:29

标签: java maven clover

I have this bit in my import requests,json,datetime,time import global_vars as gv class Create_gist: "Class for gist creation" def __init__(self,url): self.url=url self.headers=gv.headers def create(self): self.des=input("Enter the description for gist") self.public=input("Make this gist public (y/n)") if self.public=='y' or self.public=='Y': self.public='true' else: self.public='false' self.file_name=input("Enter the file name with extension ") with open(self.file_name,'r') as myfile: self.fdata=myfile.read().replace("\n", " ") print(self.fdata) self.info="hello vishal here" self.date=datetime.date.today() self.c_time=time.strftime("%H:%M:%S") self.send_dict="""{"description":"%s", "public":"%s", "files":{ "%s":{ "content":"%s" } } }""" self.send_dict=self.send_dict%(self.des,self.public,self.name,self.info) re=requests.post('https://api.github.com/gists',headers=self.headers,data=self.send_dict) print(re.status_code)

    import requests,json,datetime,time
    import global_vars as gv
    class Create_gist:
        "Class for gist creation"
        def __init__(self,url):
            self.url=url
            self.headers=gv.headers
        def create(self):
            self.des=input("Enter the description for gist")
            self.public=input("Make this gist public (y/n)")
            if self.public=='y' or self.public=='Y':
                self.public='true'
            else:
                self.public='false'
            self.file_name=input("Enter the file name with extension ")
            with open(self.file_name,'r') as myfile:
                self.fdata=myfile.read().replace("\n", " ")
            print(self.fdata)
            self.info="""hello 
            vishal here"""
            self.date=datetime.date.today()
            self.c_time=time.strftime("%H:%M:%S")
            self.send_dict="""{"description":"%s",
                    "public":"%s",
                    "files":{
                        "%s":{
                            "content":"%s"
                            }
                        }
                    }"""
            self.send_dict=self.send_dict%(self.des,self.public,self.name,self.info)
            re=requests.post('https://api.github.com/gists',headers=self.headers,data=self.send_dict)
            print(re.status_code)

I know PDF & JSON default to false. The others default to true.

Somehow when I do this, I generate HTML, XML, and even the PDF. JSON is nowhere to be found. It even says val fanIn = MergeHub.source[AllowedWSMessage].to(myActorSink).run() val fanOut = serverSource.toMat(BroadcastHub.sink[AllowedWSMessage])(Keep.right).run() // Now, somewhere in a (route-)method where you handle the websocket connection Flow.fromSinkAndSource(fanIn, fanOut) , as it does for the XML. When I go to that folder I see pom.xml and <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.3.2</version> </plugin> <plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>clover-maven-plugin</artifactId> <version>4.1.2</version> <configuration> <generateJson>true</generateJson> <generateXml>true</generateXml> <generateHtml>true</generateHtml> <generatePdf>true</generatePdf> </configuration> </plugin> </plugins> </pluginManagement> . No Generating JSON report to: /example/myrepo/target/site/clover.

If I do the following, it strangely says clover.pdf and then clover.xml.

clover.json

If I do this, it goes back to generating reports just "fine" (this example will just create the XML, no HTML). Still no JSON

No report being generated for this module.

Full config (with some things swapped to stay anon)

Generating JSON report to: /example/myrepo/target/site/clover

Update I ran <configuration> <generateJson>true</generateJson> <generateXml>false</generateXml> <generateHtml>false</generateHtml> <generatePdf>false</generatePdf> </configuration>

It generated my folder and threw a lot of JS files in it. Those files sometimes have JSON... but are wrapped in what looks like JSONP cause it will be like <configuration> <generateJson>true</generateJson> <generateXml>true</generateXml> <generateHtml>false</generateHtml> <generatePdf>false</generatePdf> </configuration> . Is this expected behavior? Is the fact they call it JSON a misnomer?

1 个答案:

答案 0 :(得分:0)

这个功能似乎应该被称为JSONP。

The docs表明它是为了输出网页上的回调所消耗的所有JS文件。它并不意味着用于解析,就像使用XML一样。